Hello,
General Info.
I have a table with Account Number and Money in database backend
I have an unbound form for input in the front end. I need to add a button, that when pressed opens another form. This form has one text box which a user can enter an account number to see if the account is already in the table. I can't get it to work. Please help.
Private Sub CmdFind_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = DBEngine.Workspaces(0).OpenDatabase("path")
Set rst = db.OpenRecordset("tblSaveEntries")
If txtAccSearch = rst!AccountNumber Then
MsgBox ("A save has already been entered for this account"), , "Save Entered"
Else
MsgBox ("No Record Found")
Me!txtAccSearch = ""
rst.Close
Set rst = Nothing
db.Close
Exit Sub
End If
General Info.
I have a table with Account Number and Money in database backend
I have an unbound form for input in the front end. I need to add a button, that when pressed opens another form. This form has one text box which a user can enter an account number to see if the account is already in the table. I can't get it to work. Please help.
Private Sub CmdFind_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = DBEngine.Workspaces(0).OpenDatabase("path")
Set rst = db.OpenRecordset("tblSaveEntries")
If txtAccSearch = rst!AccountNumber Then
MsgBox ("A save has already been entered for this account"), , "Save Entered"
Else
MsgBox ("No Record Found")
Me!txtAccSearch = ""
rst.Close
Set rst = Nothing
db.Close
Exit Sub
End If