Relating a value in one form to another form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo box that draws from a table with many hundreds of records. So
that the user doesn't have to scroll through all those records to select
their value, I created a pop up form where the user can filter by certain
criteria to narrow their search down to the find the value they want.

My challenge is that I want to create an on click event on a "Okay" button
that then calls up that record in a combo box in another form. How would I
go about doing that?
 
On your form frmX, Name your combo box (eg cboX)

Create a query with selection criteria for column that you selected BOUND
COLUMN in cboX (see properties...data)
[Forms]![frmX]![cboX]

Button <OK> (see properties, event, on click: [event procedure] and click ...)
There you write:
(if combobox in same form)Me.cboY.value = Me.cboX.value
(if combobox in other form)Form_frmOther.cboY.value = Me.cboX.value
 
The query part is not neccesary for the combo box,
though when you link your form to the query, you can make links to textboxes
to show your selection.

Zurn said:
On your form frmX, Name your combo box (eg cboX)

Create a query with selection criteria for column that you selected BOUND
COLUMN in cboX (see properties...data)
[Forms]![frmX]![cboX]

Button <OK> (see properties, event, on click: [event procedure] and click ...)
There you write:
(if combobox in same form)Me.cboY.value = Me.cboX.value
(if combobox in other form)Form_frmOther.cboY.value = Me.cboX.value




Glenn in Los Angeles said:
I have a combo box that draws from a table with many hundreds of records. So
that the user doesn't have to scroll through all those records to select
their value, I created a pop up form where the user can filter by certain
criteria to narrow their search down to the find the value they want.

My challenge is that I want to create an on click event on a "Okay" button
that then calls up that record in a combo box in another form. How would I
go about doing that?
 
Sorry, I'm not following you. If you're suggesting to write 2 "If"
statements, what are the "Then" and "Else" statements? Are you saying that
both these "If" statments would go in the on click event in the pop up form?

I'm not very advanced at VB, just learning, so I need it spelled out a
little more.

Much Appreciated,

Zurn said:
The query part is not neccesary for the combo box,
though when you link your form to the query, you can make links to textboxes
to show your selection.

Zurn said:
On your form frmX, Name your combo box (eg cboX)

Create a query with selection criteria for column that you selected BOUND
COLUMN in cboX (see properties...data)
[Forms]![frmX]![cboX]

Button <OK> (see properties, event, on click: [event procedure] and click ...)
There you write:
(if combobox in same form)Me.cboY.value = Me.cboX.value
(if combobox in other form)Form_frmOther.cboY.value = Me.cboX.value




Glenn in Los Angeles said:
I have a combo box that draws from a table with many hundreds of records. So
that the user doesn't have to scroll through all those records to select
their value, I created a pop up form where the user can filter by certain
criteria to narrow their search down to the find the value they want.

My challenge is that I want to create an on click event on a "Okay" button
that then calls up that record in a combo box in another form. How would I
go about doing that?
 
Back
Top