Autofill a subform

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

Guest

Hello.

I am trying to help a friend with his access database and I have run into a
snag. I am creating a data entry form for Ordering that needs to interact
with 2 tables. The main one is Order_History which contains information like
Name, Address, Order Number, etc. and then Order_Details which will contains
all the specifics of the order such as Size, Color, Quantity, etc. I created
one form that contains a subform so that all the information that needs to be
inputed would be in one spot. I also created a combo box for repeat orders so
that all you need to do is select the order you want to repeat, and it will
automatically fill the new form. This worked fine for the information that
goes to the main form, but I do not know the correct syntax for it to auto
fill a subform.

To autofill for a form, you write something like this as an Event Procedure:

Me.firstName = Me!ComboBox.Column(1)
Me.lastName = Me!ComboBox.Column(2)
Me.address = Me!ComboBox.Coulmn(3)
.... etc

What do you write when you want to automatically fill in a subform with the
information from a Combo Box?

Is it something like this:
Me.[Subform].Size = Me!ComboBox.Coulmn(4)

Also, when you choose data from the combo box, it will automatically fill in
what you tell it to, but when you select something else in the combo box the
data on the screen does not change. Is there something else I have to do
inorder to refresh the screen?

I greatly appreciate any assitance you could provide.

Thanks,

-Michael
 
To autofill for a form, you write something like this as an Event
Procedure:

Me.firstName = Me!ComboBox.Column(1)
Me.lastName = Me!ComboBox.Column(2)
Me.address = Me!ComboBox.Coulmn(3)
... etc

What do you write when you want to automatically fill in a subform
with the information from a Combo Box?

Is it something like this:
Me.[Subform].Size = Me!ComboBox.Coulmn(4)

Pretty close:

Me!MySubformControl.Form!txtSize = Me!ComboBox.Column(4)

Me!MySubformControl refers to the actual control on the (main) form - its
..Form property then exposes all the usual controls and properties of the
form contained inside it, If You See What I Mean.

Hope that helps


Tim F
 
Back
Top