Connecting Tech Pros Worldwide Help | Site Map

VB Command Syntax

John Baker
Guest
 
Posts: n/a
#1: Nov 12 '05
Hi:

Based on advice from this group I am attempting to run a form with a query base that calls
for variable input (a few letters of the associates last name). Howevere, when the user
clicks on "cancel", I want to close the form and continue in the macro that called the
form.

I am a total neophyte with VB, and have developed the following code: (makemodq1L is the
form in question)


Public Function MODASS()
On Error GoTo skipout
DoCmd.OpenForm Form = "[makemodq1L]"
GoTo stopit

skipout:
DoCmd.Close acForm = "[makemodq1L]"

stopit:
End Function


There is something badly wrong with the syntax in the DoCmd lines, and i don't know what
it is. Can someone give me a fix to this?

Thanks

John Baker
Douglas J. Steele
Guest
 
Posts: n/a
#2: Nov 12 '05

re: VB Command Syntax


DoCmd.OpenForm "makemodq1L"

DoCmd.Close acForm, "makemodq1L"



--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)



"John Baker" <Baker.JH@Verizon.net> wrote in message
news:56tn90hm5qt7445o91hrjnr0glbvtavale@4ax.com...[color=blue]
> Hi:
>
> Based on advice from this group I am attempting to run a form with a query[/color]
base that calls[color=blue]
> for variable input (a few letters of the associates last name). Howevere,[/color]
when the user[color=blue]
> clicks on "cancel", I want to close the form and continue in the macro[/color]
that called the[color=blue]
> form.
>
> I am a total neophyte with VB, and have developed the following code:[/color]
(makemodq1L is the[color=blue]
> form in question)
>
>
> Public Function MODASS()
> On Error GoTo skipout
> DoCmd.OpenForm Form = "[makemodq1L]"
> GoTo stopit
>
> skipout:
> DoCmd.Close acForm = "[makemodq1L]"
>
> stopit:
> End Function
>
>
> There is something badly wrong with the syntax in the DoCmd lines, and i[/color]
don't know what[color=blue]
> it is. Can someone give me a fix to this?
>
> Thanks
>
> John Baker[/color]


John Baker
Guest
 
Posts: n/a
#3: Nov 12 '05

re: VB Command Syntax


Thanks

John Baker
Closed Thread