Combo Box Action

  • Thread starter Thread starter Naimah
  • Start date Start date
N

Naimah

Depending upon the selection made from my exisiting combo
box, I would like to have another form pop up. I would
also like have the records linked in both forms. Can
anyone help with this? I would greatly appreciate any
assistance.

Thanks!
 
In the combo Box's AfterUpdate event handler, you need to
issue a DoCmd.OpenForm command. The OpenForm parameters
provide a number of ways of linking the data between the
two forms, the most commonly used are the filter parameter
and the OpenArgs parameter.

Hope This Helps
Gerald Stanley MCSD
 
Thank you! This does help. Would you mind providing an
example line of code for this?

Thanks again!!
 
Here is a couple of samples

Scenario 1.
Form2 has a recordSource where one of the columns (surname)
is the staff surnames. To filter the second form on the
selection made in the combo box cmbSurname, the statement
would look something like
DoCmd.OpenForm "Form2",,,"surname ='" & cmbSurname & "'"

Scenario 2.
Form2 is a data entry form and you want to prefill one of
the text boxes(txtSurname) with the selection from
cmbSurname. The statement would look something like
DoCmd.OpenForm "Form2",,,,,,cmbSurname

Then in the Load eventHandler of Form2, there would be code
like
txtSurname = OpenArgs

Hope This Helps
Gerald Stanley MCSD
 
Okay when I try using the DoCmd statement I get an error
message telling me that the macro does not exist. Is it
possible that I am missing a libary type component for
Access 2000?
 
It would help if you posted the exact statement that gives
the error. Please remeber that we cannot see your
database, only you can.

Gerald Stanley MCSD
 
Back
Top