Forms help please.

  • Thread starter Thread starter Nathan Sanders
  • Start date Start date
N

Nathan Sanders

Hi,

I have two forms;

FORMA displays a list of suppliers and various generic details for each.

FORMB displays transactional information for suppliers. The supplier is
selected from a combo box list.

I want to be able to call FORMB from FORMA using a command button and
automatically fill the supplier on FORMB depending on the supplier selected
on FORMA without having to retype it.

If this makes sense and you can assist it will be greatly appreciated.

Nathan
 
Put the following code in the Click event of the command button:
DoCmd.OpenForm "FormB"
Forms!FormB!SupplierID = Me!SupplierID
 
Ummm....

If FormB is bound to a table, and its DataEntry property is not set to
Yes, this will change the the SupplierID for the first record to the
SupplierID which is being displayed on FormA. I doubt this is the behavior
you want.

If you want to start a new record in FormB every time you click the
button, you can set FormB's DataEntry property to Yes, and use the code
below.

If you want to look at existing records for this supplier, you'll need a
different approach.

HTH
- Turtle
 
Back
Top