Trying to open form from command button

B

babs

I have created a button on the form to open another form based on the values
int he given field - I get t a syntax error- I am dealing with a date field
so not sure of the correct syntax

DoCmd.OpenForm "JeffSchedNotes", , ,([workdate]=#" & Me.txtWorkdate & "#;")

any ideas???

help,
thanks,
Barb
 
L

Larry Linson

babs said:
I have created a button on the form to open another form based on the
values
int he given field - I get t a syntax error- I am dealing with a date
field
so not sure of the correct syntax

DoCmd.OpenForm "JeffSchedNotes", , ,([workdate]=#" & Me.txtWorkdate &
"#;")

any ideas???

Try putting a quote before [workdate]=. That's an obvious one, if it's not
a typo.

Larry Linson
Microsoft Office Access MVP
 
B

babs

I set up the form to open in datasheet view so you can see all records(notes)
for that given date. However even when I set the view in design view to
datasheet view - it is opening the form up so you can only see ! record at a
time ??? like continous view - what am I missing???

thanks,
barb

Daniel Pineault said:
Try:

DoCmd.OpenForm "JeffSchedNotes", , ,"[workdate]=#" & Me.txtWorkdate & "#")

--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



babs said:
I have created a button on the form to open another form based on the values
int he given field - I get t a syntax error- I am dealing with a date field
so not sure of the correct syntax

DoCmd.OpenForm "JeffSchedNotes", , ,([workdate]=#" & Me.txtWorkdate & "#;")

any ideas???

help,
thanks,
Barb
 
F

fredg

I set up the form to open in datasheet view so you can see all records(notes)
for that given date. However even when I set the view in design view to
datasheet view - it is opening the form up so you can only see ! record at a
time ??? like continous view - what am I missing???

thanks,
barb

Daniel Pineault said:
Try:

DoCmd.OpenForm "JeffSchedNotes", , ,"[workdate]=#" & Me.txtWorkdate & "#")

--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.

babs said:
I have created a button on the form to open another form based on the values
int he given field - I get t a syntax error- I am dealing with a date field
so not sure of the correct syntax

DoCmd.OpenForm "JeffSchedNotes", , ,([workdate]=#" & Me.txtWorkdate & "#;")

any ideas???

help,
thanks,
Barb

Regardless of the form's DefaultView setting that opens the form in
Datasheet View, if you open the form from a VBA event using the
OpenForm method you MUST specify datasheet view.

DoCmd.OpenForm "FormName", acFormDS, , etc.....

Look up the OpenForm method in VBA help and check out the various
arguments the method accepts.
 
B

babs

Got the datasheet view - thanks and looked up the VB Open form method - but
now can not figure out how to make it show up NOT maximized - would like it
near bottom right of screen??? tried DoCmd.MoveSize 1440, 2400, , 2000 but
still opened maximized???

thanks soo much for helping,
barb

fredg said:
I set up the form to open in datasheet view so you can see all records(notes)
for that given date. However even when I set the view in design view to
datasheet view - it is opening the form up so you can only see ! record at a
time ??? like continous view - what am I missing???

thanks,
barb

Daniel Pineault said:
Try:

DoCmd.OpenForm "JeffSchedNotes", , ,"[workdate]=#" & Me.txtWorkdate & "#")

--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.

:


I have created a button on the form to open another form based on the values
int he given field - I get t a syntax error- I am dealing with a date field
so not sure of the correct syntax

DoCmd.OpenForm "JeffSchedNotes", , ,([workdate]=#" & Me.txtWorkdate & "#;")

any ideas???

help,
thanks,
Barb

Regardless of the form's DefaultView setting that opens the form in
Datasheet View, if you open the form from a VBA event using the
OpenForm method you MUST specify datasheet view.

DoCmd.OpenForm "FormName", acFormDS, , etc.....

Look up the OpenForm method in VBA help and check out the various
arguments the method accepts.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top