I have a form named frmHours
it opens a table named hours to new record
table called Hours
field in table is called Contractor (number field lookup) combo
on Form I changed from combobox to text and it enters info from form to detail section- set to continuous form
by:
control source set to for form =[Forms]![frmHours]![txtContractor]
Here is Code for Form:
Option Compare Database
Option Explicit
Private Sub Command5_Click()
DoCmd.Close acForm, Me.Name
End Sub
Private Sub Form_Load()
Dim iEdit As Integer
'populate the text boxes
Me.txtName = Environ("username")
Me.txtDate = Date
Me.txtContractor = DLookup("Contractor", "Contractors", "Login='" & Forms!FrmMenu!txtUser & "'")
'set edit permissions
iEdit = Forms!FrmMenu!txtLevel.Value
Select Case iEdit
Case Is < 2
Me.AllowEdits = False
Case Else
Me.AllowEdits = True
End Select
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
ModBy = Environ("username")
ModDate = Now()
End Sub
However, it is saving all info to Hours table but not name(contractor) field, what step am I missing
Thanks,