I am using Access 2003. I have a list box on a form which has 6 columns in it, with data taken from a table. I have an unbound text box which holds the ID number for the selected item in the list box. I have a command button which I want to use to open another form on that record. At the moment it opens the other form but only to the first record. The other form has its recordset set to the same table as what the list box displays certain data for. Basically, the list box displays certain more important data, and the user clicks on the item to be viewed and then the next form displays all the data.
I have used this code to try and open the form to the correct record with no luck:
Expand|Select|Wrap|Line Numbers
- Private Sub cmbSelected_Click()
- Dim stLinkCriteria As String
- stLinkCriteria = "[RiskEstimateID] = '" & Me.txtLstRPET & "'"
- DoCmd.OpenForm "RiskEstimating", acNormal, , stLinkCriteria, , acNormal
- End Sub
Expand|Select|Wrap|Line Numbers
- Private Sub cmbSelected_Click()
- DoCmd.OpenForm "RiskEstimating", acNormal, , , , acNormal, Me.txtLstRPET
- End Sub
- Private Sub Form_Open(Cancel As Integer)
- Me.RiskEstimateID = Me.OpenArgs
- End Sub
Many thanks in advance,
Andrew