Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data entry or data view? that is the question 2

Status
Not open for further replies.

telephoto

Technical User
Nov 3, 2002
210
GB
Greetings all - it's been a while.
I have a form designed to show records of a customer's machines. I open the form from another form using an SQL string to show the customer's info required. This has a global variable set as SqlSet2=true. The form on open checks the sqlset and opens to display the data.
I would like to use the same form accessed from a different form for data entry only, this would have a different SQL string as recordset, with a different global variable set as True.
I have tried using the instruction DoCmd.OPENFORM (frmName,,,,acFormAdd) but this refuses to compile, insisting on an = sign.
Unless one of you experts can help I am going to have to use a duplicate form.
Thanks

Telephoto
 
Did you copy this from your code?
Did you include the ()s?
I assume you set the value of frmName someplace?

You haven't provided much information about your variable and record sources but this shouldn't cause a compile issue.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Try without parentheses: [tt]DoCmd.OPENFORM frmName,,,,acFormAdd[/tt]. Arguments in parentheses are used when you set a variable and there is a function with or without arguments on the right side.

combo
 
Hello to both.
Duane, it's been a while - how was Switzerland?

I've awarded a star each, between you my problem is solved.

Using Docmd.Openform ("frmname",,,,acFormAdd) generates the compile error.
I must define "frmName" as a variable, then
Docmd.openform stdocname,,,,acFormAdd without () works a treat.

Many thanks

T
 
Good to hear you got this worked out.

Switzerland was wonderful. Lots of great adventures!

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top