Full Version: Pass Info to a Query
UtterAccess Forums > Microsoft® Access > Access Forms
elliot315
I have a form that passes some values (date,name, number) to a query and to a report. The problem is that if I close the form the field that is passed to the report directly (name) appears as an error... how do I pass the value and do not appear as an error if I close that form?
How do I set the visibility to false on the command that opens the report? that's the idea I have so far but I'm not good at vba.
theDBguy
I would do it the other way, hide the form when you open the report and then close it after you close the report. To hide the form:
orms!NameOfForm.Visible = False
to bring it back
Forma!NameOfForm.Visible = True
HTH
elliot315
Thanks... How Do I close it automatically when closing the report?
Omean.. not to bring it visible again and close it manually?
freakazeud
Programmatically close it in the reports close event e.g.:
oCmd.Close acForm, "YourFormName"
HTH
Good luck
elliot315
Thanks...now it's doing what I wanted! Thanks
How about a good book to learn VBA.. I mean from newbie to advanced... or some books
freakazeud
Do a search on UA about suggested reading and you should find many many discussions with good suggestions.
HTH
Good luck
theDBguy
You're welcome. Glad to see you got it fixed. Thanks to Oli for the assist.
If you have any macros, try converting them to VBA via Tools > Macro > Convert Macros to Visual Basic and you can study the difference. Good luck with your project.
elliot315
Thanks for the suggestion... very good in fact.. thanks
theDBguy
NP. thumbup.gif
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.