Form and table question

thompson

New member
Local time
Today, 11:30
Joined
Dec 10, 2004
Messages
5
I am new to access and programming in general. I have a form that has combo boxes linked to tables that coninside together. Is there a way to have the information that a user enters in a form to pass over to a table?

Lets say there are these three combo boxes and one item box:

Category :(COmbo box pulling the Categories from the Category table)

Manufacturer: (Pulling from Manufacturer from the Manufacturer Table)

Condition: (Pulling from Condition from Condition table)

Item: Unbound Text box. (User Enters Item here)

Then I would like them to hit a button and it pulls all the data from these fields and throws it into the Inventory table. The inventory table has all these feilds with the exact same name. I dont know how to export from the form into another table. Any help or sugestions would help so much. Thanks!
 
Hi

The obvious way would be to bind the form to the inventory table and change the control source on each combo/text box to the field in the inventory table.

Assuming you have an unbound form and want to do it the other way, then in the 'on click' event for your button try.

Docmd.RunSql "INSERT INTO tblInventroy (Category ,Manufacturer, Condition, Item) VALUES ('" & Category & "','" & Manufacturer & "','" & Condition & "','" & Item & "')"

You may need to check for invalid entries before running this eg:-
if len(Item) = 0 then Msgbox "Invalid Item":exit sub
etc

Hope that helps

Paul
 
Your know your stuff

It seems to work with your suggestion. I have the basic stuff down. Thanks for all your help and quick response! :D
 

Users who are viewing this thread

Back
Top Bottom