form linking

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

Guest

I have a form in which I have a list box (lookup table)in
the header and depending on the choice, I would like to
display records from another table. I am unable to
accomplish this. Could anyone help. I know this is very
basic..but I seem not to find much help.

Thanks
 
The code below calls a form to receive items ordered on a PO where the PO
line items already exhist but the quantities to be received and prices need
to be entered. This should help.

Private Sub QtyRec_Click()
Dim desc As String

If Qty > 0 Then
stDocName = "purchaseReceipts"
stLinkCriteria = "[purchid]=" & Me![PurchId] & " and " & "[DeviceId]= "
& Me![DeviceId] & " and " & "[Description]= '" & Me.Description & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else: MsgBox "There is nothing to be received"
End If
End Sub
 
I am sorry but i do not understand. Let me show you what
I am doing. I really appreciate the help because I have
been struggling with this since yesterday. I have tables
Department and AssignCostCenter.

In the form i create, the DepartmentName (only field in
Department) is a list box in the header. Depending on the
value of the DepartmentName (eg. Accounting), I would like
the Detail to list all the Cost centers in Accounting
(AssignCostCenter table has only DepartmentName and Cost
Center-many to many relationship if you consider that
Manufacturing will also have the same Cost Centers).

I have tried a single form, form/subform...something or
the other is not working.Any help is much appreciated.
Thankyou.
-----Original Message-----
The code below calls a form to receive items ordered on a PO where the PO
line items already exhist but the quantities to be received and prices need
to be entered. This should help.

Private Sub QtyRec_Click()
Dim desc As String

If Qty > 0 Then
stDocName = "purchaseReceipts"
stLinkCriteria = "[purchid]=" & Me![PurchId] & " and " & "[DeviceId]= "
& Me![DeviceId] & " and " & "[Description]= '" & Me.Description & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else: MsgBox "There is nothing to be received"
End If
End Sub

I have a form in which I have a list box (lookup table) in
the header and depending on the choice, I would like to
display records from another table. I am unable to
accomplish this. Could anyone help. I know this is very
basic..but I seem not to find much help.

Thanks
.
 
Back
Top