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!

Access wizard commands in VBA

Status
Not open for further replies.

robdunfey

Technical User
Apr 26, 2002
110
GB
Hi Guys,

The Scenario:

I have a table will 4 fields in it named a,b,c & d respectively.

I go to 'Create Form by using wizard', it lets me select the fields a,b,c & d. Then I can choose to display the data in a tabular fashion with a 'standard' style. I give the form a name and click finish. The form displays the fields a,b,c & d for every record in the table.

I want to do this programmatically. I have found the CreateForm() method which is useful, but I don’t know how to create a form that displays records and fields, as is possible with the wizard. Any ideas, code or suggestions much appreciated.

Rob
 
I have figured out how to create controls on forms using the createcontrol property/method.

So I can create a form and add a text box. I want to set the controlsource of this text box to a field in a table. But I can not do this because when i run my code with the object does not exist until half of the code has been executed. e.g.

make form
add control
theaddedcontrol.controlsource = myfield

the added contol does not exist when the code starts to run. any ideas how i might get around this are much appreciated.

rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top