S
Snoopy33
I appologize if this has been covered in a different post; I searched
but did not find anything that helped with my specific problem.
I have two databases: RMA database and Parts Request database. I have
linked two tables from my RMA database to my Parts Request database.
The two tables that i linked are RMA Generator and Products. RMA
Generator is used on my master form for RMA's and Products is used for
the subform which sometimes contains multiple records (parts) per
single RMA.
My goal is to be able to use DLookup to auto populate as much data as
possible in my Parts Request database to avoid entering information
redundently.
My Parts request database contains two tables; Order Information and
Parts for the same reason as above, the Parts table contains multiple
records for single Part Order.
In using DLookup, I get it to populate the main form with no problems,
but now am getting nowhere in trying to populate the subform. My
questions are:
Is this even possible to populate multiple records based on a field
(not primary key) from the subform's table?
If it is possible, what is the syntax? Here's what i've tried up to
this point
Private Sub Combo107_AfterUpdate()
On Error Resume Next
Combo107.SetFocus
If Combo107.Value > 0 Then
Me.[Customer] = DLookup("customername", "[rma generator]",
"[rma#]=" & Combo107)
Me.[work order number] = DLookup("workorder", "[rma
generator]", "[rma#]=" & Combo107)
Me.[Company] = DLookup("customername", "[rma generator]",
"[rma#]=" & Combo107)
Me.[requested by] = DLookup("[generated by]", "[rma
generator]", "[rma#]=" & Combo107)
Me.[rma#] = DLookup("[categoryid]&[rma#]", "[rma generator]",
"[rma#]=" & Combo107)
Forms.Parts.Qty = DLookup("quantity", "products", "[rmaID]=" &
Me.Combo107)
End If
End Sub
I haven't tried to get the other two fields to populate for the
subform. I didn't figure that there was any reason until i can get one
to populate.
Thanks in advance for any help
but did not find anything that helped with my specific problem.
I have two databases: RMA database and Parts Request database. I have
linked two tables from my RMA database to my Parts Request database.
The two tables that i linked are RMA Generator and Products. RMA
Generator is used on my master form for RMA's and Products is used for
the subform which sometimes contains multiple records (parts) per
single RMA.
My goal is to be able to use DLookup to auto populate as much data as
possible in my Parts Request database to avoid entering information
redundently.
My Parts request database contains two tables; Order Information and
Parts for the same reason as above, the Parts table contains multiple
records for single Part Order.
In using DLookup, I get it to populate the main form with no problems,
but now am getting nowhere in trying to populate the subform. My
questions are:
Is this even possible to populate multiple records based on a field
(not primary key) from the subform's table?
If it is possible, what is the syntax? Here's what i've tried up to
this point
Private Sub Combo107_AfterUpdate()
On Error Resume Next
Combo107.SetFocus
If Combo107.Value > 0 Then
Me.[Customer] = DLookup("customername", "[rma generator]",
"[rma#]=" & Combo107)
Me.[work order number] = DLookup("workorder", "[rma
generator]", "[rma#]=" & Combo107)
Me.[Company] = DLookup("customername", "[rma generator]",
"[rma#]=" & Combo107)
Me.[requested by] = DLookup("[generated by]", "[rma
generator]", "[rma#]=" & Combo107)
Me.[rma#] = DLookup("[categoryid]&[rma#]", "[rma generator]",
"[rma#]=" & Combo107)
Forms.Parts.Qty = DLookup("quantity", "products", "[rmaID]=" &
Me.Combo107)
End If
End Sub
I haven't tried to get the other two fields to populate for the
subform. I didn't figure that there was any reason until i can get one
to populate.
Thanks in advance for any help