Open form and pass data

dcjones

Dereck
Local time
Today, 11:36
Joined
Mar 10, 2004
Messages
108
Hi All,

I should know how to do this but my brain has gone blank.

I have a form "frmMainClient" which has a field "account_no".

On the main form "frmMainClient" I have a command button which opens a pop up form ""frmJobNew" where I can enter a new job record. The "frmJobNew" form has a field "account_no".

I am trying to auto fill the "account_no" field with the data from the "frmMainClient" - "account_no" field and store the passed data when the record is saved.

I can pass the data using "=forms![frmMainClient]![account_no] in the "account_no" field on the "frmJobNew" but when I save the record the data is not saved.

Can anyone offer help, please

Many thanks.
 
Maybe you should put this:

forms![frmMainClient]![account_no]

In the default value of the textbox on the popup form...(?)
 
Hi and thanks for the reply.

I currently have the following code on the "Click" event.

Private Sub Command40_Click()
On Error GoTo Err_Command40_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmJobNew"
DoCmd.OpenForm stDocName, , , , acFormAdd

Forms![frmJobNew]![account_no] = Forms![frmMainClient]![account_no]

Exit_Command40_Click:
Exit Sub

Err_Command40_Click:
MsgBox Err.Description
Resume Exit_Command40_Click

End Sub

All the other data is saved apart from the data in the "account_no" field.

Any ideas.

Many thanks
 
Hi all,

I have sorted out my problem. My error, the "aacount_no" filed was not bound to the table field.

Sorry, I'm a plank

Many thanks
 

Users who are viewing this thread

Back
Top Bottom