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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a new record to a table. (Not as easy as I originally thought!) 1

Status
Not open for further replies.

Chyld

Programmer
Jul 25, 2001
48
GB
I have a table called Sample_Selections
It has the following fields

Sample_ID Autonumber
Product_Name Text
Product_Type Text
Product_Size Text
Quantity Text

I have an unbound form 'Sample_Selector' with 4 list boxes in it. each based on a query that updates the next with available options.

Once the 4 list boxes have been updated, a subform appears with details for the user (the above table) on how it should be entered into another system properly.

The subform is called 'Sample_Selector_Subform' and this too is based on a query using the 4 above listboxes as criteria.

What I want to do mainly is be able to add the instructions to the 'Sample_Selections' table every time the 'add item' button is pressed on the 'Sample_Selector' form.

This information will then act as a product line on another subform, probably have to be a continuous form, using the table as it's base.

How do I do this?

Please explain the information that you give to me because I don't understand code that well....

craig@chyld.co.uk

 
If you want to add a new record or edit the data in a subform here's how

'add record to sub form
Me![Yoursubform].SetFocus 'must do this first
DoCmd.GoToRecord , , acNewRec 'add a new record if you needd to

'assign a value to a field in that sub form
Me![Yoursubform].Form![DrawingNumber] = ActiveXCtl1.FileName

'save the record
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

' Requery the sub form
Me![Yoursubform].Requery

DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top