Howlsta
Vampire Slayer
- Local time
- Today, 11:53
- Joined
- Jul 18, 2001
- Messages
- 180
I'm making a form where a student can pick from a choice of modules. A student enters their card number and surname and they are then allowed to choose options from a cbo. The problem is I want to add their choice of options by adding the moduleIDF and StudentIDF to another table. The StudentIDF is autonumber, and the card number is unique and in the same table. I think i need code that gathers the StudentIDF from the library card number entered so the addnew method will work properly. Does anyone understand, if so do you know how to this pls?
Private Sub cmdSelect_Click()
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
With rst
.ActiveConnection = CurrentProject.Connection
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open "Select * from qryPickOption"
.AddNew
!StudentIDF = Me.StudentIDF
!ModuleIDF = Me.cboOptionalMod
.Update
End With
Me.lboOptions.Requery
End Sub
Private Sub cmdSelect_Click()
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
With rst
.ActiveConnection = CurrentProject.Connection
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open "Select * from qryPickOption"
.AddNew
!StudentIDF = Me.StudentIDF
!ModuleIDF = Me.cboOptionalMod
.Update
End With
Me.lboOptions.Requery
End Sub