How to copy the current data value in a combo box on one form to a text box on anothe

croby

Registered User.
Local time
Today, 05:22
Joined
Feb 27, 2003
Messages
29
Hi,
I have a form with 2 combo boxes. Each of them bound 2 columns: ID and Name. They are based on 2 cascading tables.
( I don't want to use the automatic Subform technique).

When I double click the second combo, it pops up a form with 3 text boxes on it.
One is the box for number field. This box should receive the ID from the first Combo box:

Forms![My_form_Name]![cboFirst].Column(0)

I don’t know how to send the above data to the text box on the 2nd form. Any idea of hint will be appreciated. Thanks. Chris
 
Add to the OnDoubleClick Event:

[Form]![frmOPeningForm]![TextboxName] = [Forms]![My_form_Name]![cboFirst].Column(0)

HTH
 
Hi, thnaks for the prompt reply. I inserted your codes into my Double click event procedure. I don't know what's wrong. It couldn't find the form( 2nd, opened form). Can you tell me what's wrong?

Private Sub cboSubsystem_DblClick(Cancel As Integer)
On Error GoTo Err_cboSubSystem_DblClick
Dim strcboSubSystem As String

If IsNull(Me![cboSubsystem]) Then
Me![cboSubsystem].Text = ""
Else
strcboSubSystem = Me![cboSubsystem]
Me![cboSubsystem] = Null
End If
DoCmd.OpenForm "Subsystem_form", , , , , acDialog, "GotoNew"
[Forms]![Subsystem_form]![System_No] = [Forms]![Incident_Data_Entry]![cboSystem].Column(0)
Me![cboSubsystem].Requery
If strcboSubSystem <> "" Then Me![cboSubsystem] = strcboSubSystem

Exit_cboSubSystem_DblClick:
Exit Sub

Err_cboSubSystem_DblClick:
MsgBox Err.Description
Resume Exit_cboSubSystem_DblClick
End Sub
--------------------------
Error Message:
"Can not find the form Subsystem_form referred to a macro expression or Visual basic code. "

I do not have macro. must be something in the code.

Thanks a lot. Chris
 

Users who are viewing this thread

Back
Top Bottom