umm..what I meant to ask is. I am not sure how to convert this macro code:
SetTempVar
Name ActiveControlValue
Expression = [Screen].[ActiveControl]
SearchForRecord
Object Type
Object Name
Record First
where condition =="[lngID]=" & [TempVars]![ActiveControlValue]
to vb code! The syntax is not the same for both. This is the code I used in vb to convert the macro (wrote the code manually as access doesn't support macro to code conversion):
Private Sub cmbEditUser_AfterUpdate()
Me.txtUserName = Me.cmbEditUser.Column(1)
TempVars("ActiveControlValue") = Screen.ActiveControl
DoCmd.SearchForRecord , "", "", "[lngEmpID] = " & "[TempVars]![ActiveControlValue]"
End Sub
But I am getting an error stating "Tempvars can only store data. They cannot store objects"