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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening a form with a date

Status
Not open for further replies.

techkenny1

Technical User
Jan 23, 2009
182
AU
Hi,
How do I change this code so that a form will open by using the on click event.
I have tried this code, but only get an error,
"DoCmd.Openform "Form125Sch_3", , , "Date=" & Me.Date"

regards,
KP
 
DoCmd.Openform "Form125Sch_3", , , "Date=#" & Me.Date & "#"

Good luck

[pipe]
Daniel Vlas
Systems Consultant

 
Many thanks for your reply.
I have used this code,the form opens ok, but the data with the corresponing data does not show.

If I just open the form by itself, the data is there.

Is there any other variation on this code that I can try to get it to work?
KP
 
DoCmd.Openform "Form125Sch_3", , , "[Date]=#" & Me.Date & "#"

If at all possible, change the field name from "Date" to anything else.
In the future, avoid using reserved names at all costs.


[pipe]
Daniel Vlas
Systems Consultant

 
Thank you Daniel, for your great reply.
Its another valuable lesson learnt. Ive changed the field to relect a different name.
And it works reall ygreat.

Thank you
KP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top