From: Dirk Goldgar on 7 Jan 2010 16:26 "Bill" <Bill(a)discussions.microsoft.com> wrote in message news:CF3449A5-D2F6-41E9-ABA0-93BE61A0F0EB(a)microsoft.com... > > > Here is what I typed DoCmd.OpenForm "Tenants Move In". . . .acFormAdd I see you have periods instead of commas. That would certainly be an error. Did you type that directly into the button's On Click event property (that would be an error), or did you create an event procedure and put this line of code inside that event procedure (that would be the right way to do it)? -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup)
From: fredg on 7 Jan 2010 16:37 On Thu, 7 Jan 2010 13:20:01 -0800, Bill wrote: > Here is what I typed DoCmd.OpenForm "Tenants Move In". . . .acFormAdd That's not what I suggested. You have used dots in place of commas. The correct syntax is: DoCmd.OpenForm "FormName", , , , acFormAdd That's 4 commas after "FormName" Look up, in VBA help, the OpenForm method for the correct syntax. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail
From: Linq Adams via AccessMonster.com on 7 Jan 2010 19:01 "All it did was come up with a message that it couldn't find the object 'DoCmd'" Making the mistake with using periods instead of commas should have popped up a "syntax error" message, but I don't think Access ever got that far! Access stating it "couldn't find the object 'DoCmd'" suggests to me that the OP probably has a missing reference that causing Access to error out. The periods do, of course, also need to be replaced with commas. -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via http://www.accessmonster.com
From: Dirk Goldgar on 7 Jan 2010 20:13 "Linq Adams via AccessMonster.com" <u28780(a)uwe> wrote in message news:a1c6ff9fda080(a)uwe... > "All it did was come up with a message that it couldn't find the object > 'DoCmd'" > > Making the mistake with using periods instead of commas should have popped > up > a "syntax error" message, but I don't think Access ever got that far! > > Access stating it "couldn't find the object 'DoCmd'" suggests to me that > the > OP probably has a missing reference that causing Access to error out. If Bill put the statement directly into the On Click property of the command button, then clicking the button would give the error message "<database name> can't find the macro 'DoCmd.'" My guess is that this is what has happened. -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup)
From: Linq Adams via AccessMonster.com on 8 Jan 2010 14:12 Good point, Dirk! I hadn't even considered that! Be nice to get some feedback from the OP. -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via http://www.accessmonster.com
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: How do you get calculated fields on access forms Next: Saving an access form |