Upon choosing a value in a combo box, it opens a popup form. However when closing the popup I want the value in the combo box to disappear also rather than the value just chosen, how can I accomplish this.
Also is there a way to specifically position the popup on the screen.
Here is the code I am using. Thanks.
Private Sub LookItUp(strSQL)
Set dbs = CurrentDb()
'ignore error if query "qryEdit" doesn't exist.
On Error Resume Next
dbs.QueryDefs.Delete ("qryEdit")
On Error GoTo 0 'reset error checking
'create a query
Set qd = dbs.CreateQueryDef("qryEdit", strSQL)
End Sub
Private Sub cmboFullName_BeforeUpdate(Cancel As Integer)
strSQL = "Select * from tblMedStaff where Full_Name=" & Chr(34) & cmboFullName & Chr(34)
Call LookItUp(strSQL)
DoCmd.OpenForm "frmEdit", , , , , acDialog
End Sub
Also is there a way to specifically position the popup on the screen.
Here is the code I am using. Thanks.
Private Sub LookItUp(strSQL)
Set dbs = CurrentDb()
'ignore error if query "qryEdit" doesn't exist.
On Error Resume Next
dbs.QueryDefs.Delete ("qryEdit")
On Error GoTo 0 'reset error checking
'create a query
Set qd = dbs.CreateQueryDef("qryEdit", strSQL)
End Sub
Private Sub cmboFullName_BeforeUpdate(Cancel As Integer)
strSQL = "Select * from tblMedStaff where Full_Name=" & Chr(34) & cmboFullName & Chr(34)
Call LookItUp(strSQL)
DoCmd.OpenForm "frmEdit", , , , , acDialog
End Sub