Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2008

Tip: Looking for answers? Try searching our database.

Using a query form in VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
senseinobaka - 25 Mar 2008 20:06 GMT
Hello.
I'm new to Access and VBA. I have set up a table called "Customer Visits"
Then I have a query when ran will return every record in "Customer Visits".
My next step was to make a Parent/Child Form that would allow me to chose a
customer and then search my table using the query and the customer criteria.
That works great and I end up with child form that shows me all the matching
records.

My goal is to move those desired records to a Word Table. If I place a
button besides the record and run mt VBA code it will work well. But I need
to go down each record and push the command button. This is just asking for
oversights. Is there anyway I could use just 1 command button and loop thru
all the records on my form?

I appreciate your help.
Margaret Bartley - 26 Mar 2008 02:17 GMT
> Hello.
> I'm new to Access and VBA. I have set up a table called "Customer Visits"
[quoted text clipped - 16 lines]
> thru
> all the records on my form?

If I understand your request properly, you want to export to Word the detail
records for a given customer?

The best way to do this is to put in a command button on your form that says
something like, "Export customer detail to Word", and put the code in the
command button to create a recordset that you export to Word.

Depending upon how complex the query is, you might want to either create a
parameterized query that stays in your database, and run it in code, passing
the parameter, or, if it's fairly simple, you can create the query in your
code, send it to Word, and then delete the query.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.