form to form data

tricky354

Registered User.
Local time
Today, 11:54
Joined
Apr 18, 2007
Messages
18
i use this code on my button to open another form called frmAuto_Quote

Private Sub cmdAutoQuote_Click()
DoCmd.OpenForm "frmAuto_Quote"
DoCmd.Close acForm, "frmInventory", acSaveYes
End Sub

how can i make 'frmAuto_Quote' access the correct record from my main table called 'inventory'

can any one point me in the right direction
 
Just so I understand your question;

You have a form frmInventory with a data source table inventory.
Your have a form frmAuto_Quote with a data source table inventory.

and you want to open the form frmAuto_Quote to display the same record that the frmInventory was displaying. I have not added code to close the frmCusName you can do this if you wish

If I am correct then have a look at my attached sample. If my assumption is wrong them post back.
 

Attachments

And for the record, the acSaveYes in:
DoCmd.Close acForm, "frmInventory", acSaveYes
is for saving changes to the form design but *not* the underlying RecordSet.
 
To save a record in the underlying recordset explicitly, use:

DoCmd.RunCommand acCmdSaveRecord
 
But unless you take extra steps, if the form is Dirty the current record is saved when the form closes.
 
Exactly -

restated as:

If you enter any part of a new record, or edit an existing one, the minute you move to another record or close the form, the record is updated unless you utilize the BeforeUpdate event to set Cancel=True to stop the update and then use Me.Undo or DoCmd.RunCommand acUndo to undo the changes.
 
many thanks but...

i'm not sure if i explained myself correctly.
I need to make a 'popup window' from a button named 'auto quote' which the user can enter infomation into and when submitted it will update a table called 'inventory_quotes' and show under the tab 'quotes'

please take a look at my attached file to see how far i've come so far - just need to figure these few last things out
 

Attachments

Your examples are read only so can't be changed by anyone but you.

Look at this link, I sent in some code to open a report linked to a record on a form. Change it to open your popup. As long as you have the Record's primary key on each form it will work.
 

Users who are viewing this thread

Back
Top Bottom