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!

Noobie to forms

Status
Not open for further replies.

andyc209

IS-IT--Management
Dec 7, 2004
98
GB
Having spent years on SQL I want to make a small Access customer database application. I have set up a form with form fields etc on but want to pull data from three tables. One contains the customer address information, the other contains the possible products they may buy and the third table contains information about the sales person.

However, it seems I can only use one table per form, is this true? Is there a way I can get the product info into a dropdown on the page as well as the sales person. There is no link between all the tables except I want the form to post into a fourth table with the relevant information.

Also is there a macro i can call to delete a record (can only find delete an object)

thanks for any help
 
Several Ways. You can place multiple subforms, on a form. You can link the subforms to the main form, or choose not to link the subforms to the main form. I would go through the help file and look at subforms. The examples tend to only show a sub form linked to a main form, but you do not have to do that. You can have multiple subforms showing data from multiple queries.

Controls can also have their own rowsource showing data from recordsources other than the main form. So you can have listboxes or comboboxes pulling data not in the main form record source.

Most people on this site do not use the macros, but use VBA. If you are strong in sql then you definitely want to go VBA. You can write a SQL string and then run in.

dim strSQL as string
strSQL = "DELETE * from ...."
currentDB.execute strSQL

This way you can use variables in your SQL string, to control program flow.

Take a look at the Northwind database that ships with Access. It has several subform examples.

Also take a look at the database aggregate functions:
dlookup
dmax
dmin
dcount
...
Another way to pull data from another recordsource.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top