missinglinq,
Thank you for you reply and sample code.
the to codes are,
start of text box -------------,
Private Sub Command7_Click()
On Error GoTo Err_Command7_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmStation"
stLinkCriteria = "[StationName]=" & "'" & Me![Text0] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command7_Click:
Exit Sub
Err_Command7_Click:
MsgBox Err.Description
Resume Exit_Command7_Click
End Sub
end of text box------------
Start combo box----------
Private Sub Command6_Click()
On Error GoTo Err_Command6_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmStation"
stLinkCriteria = "[StationName]=" & "'" & Me![Combo2] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command6_Click:
Exit Sub
Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click
End Sub
combo box----------
when i press the command buttom for the text box the form that opens, the there is a text box on that form and the text box is populated with the selected selected data from the first form,
But when i do the same with the combo box the form opens but there the text box is not populated with any data.
both buttons are linked to the same form and text box.
I will have a play with the code you sent me to see if it helps me
Peter