What i want to do is when a paper is selected from a combobox in a form, the price of the paper is displayed in a textbox below it.
The text below is what i have so far, it doesn't work and i can't see why! It is entered in 'event'/ 'after update'
Combo36 is the name of the combobox being changed, paper1 is the table that the papers primary key is located and paperno is the papers primary key.
option Compare Database
Private Sub combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "paper1.[paperno] = " & Str(Me![Combo36])
Me.Bookmark = rs.Bookmark
End Sub
Private Sub exit_Click()
On Error GoTo Err_exit_Click
DoCmd.Close
Exit_exit_Click:
Exit Sub
Err_exit_Click:
MsgBox Err.Description
Resume Exit_exit_Click
End Sub
The text below is what i have so far, it doesn't work and i can't see why! It is entered in 'event'/ 'after update'
Combo36 is the name of the combobox being changed, paper1 is the table that the papers primary key is located and paperno is the papers primary key.
option Compare Database
Private Sub combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "paper1.[paperno] = " & Str(Me![Combo36])
Me.Bookmark = rs.Bookmark
End Sub
Private Sub exit_Click()
On Error GoTo Err_exit_Click
DoCmd.Close
Exit_exit_Click:
Exit Sub
Err_exit_Click:
MsgBox Err.Description
Resume Exit_exit_Click
End Sub