N
Nick T
Hi,
Can i display query data onto a form (in text boxes) using some code behind
a command button?
I currently have the following code, which displays one of my queries
records (the first record of potentially several) however i want my form to
display all records in my query where the 'sequenceNo' appears:
Private Sub ShowDetail_Click()
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("BatchIngredientDetail", dbOpenDynaset)
With rst
.FindFirst "[SequenceNo] = " & Me.Batch
Me.BatchNo = !SequenceNo
Me.RMCode = !RawMaterialCode
Me.RMDescription = !Description
Me.TargetWeight = ![Sum Of WeightStd]
Me.ActualWeight = ![Sum Of WeightActual]
.Close
End With
Set rst = Nothing
End Sub
I hope this makes sence, however basically, i want to display on my form all
of the query records where the 'SequenceNo' matches a 'Batch' number which i
type into a text box. (the above code is behind a cmd button, so all a user
has to do is input a batch number & click the cmd button)
Hope somone can help.
Many thanks
Can i display query data onto a form (in text boxes) using some code behind
a command button?
I currently have the following code, which displays one of my queries
records (the first record of potentially several) however i want my form to
display all records in my query where the 'sequenceNo' appears:
Private Sub ShowDetail_Click()
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("BatchIngredientDetail", dbOpenDynaset)
With rst
.FindFirst "[SequenceNo] = " & Me.Batch
Me.BatchNo = !SequenceNo
Me.RMCode = !RawMaterialCode
Me.RMDescription = !Description
Me.TargetWeight = ![Sum Of WeightStd]
Me.ActualWeight = ![Sum Of WeightActual]
.Close
End With
Set rst = Nothing
End Sub
I hope this makes sence, however basically, i want to display on my form all
of the query records where the 'SequenceNo' matches a 'Batch' number which i
type into a text box. (the above code is behind a cmd button, so all a user
has to do is input a batch number & click the cmd button)
Hope somone can help.
Many thanks