defining variables and issues with running different queries based

N

nadine

Below is the code that I am using to try to run different queries based on
the results returned from a certain field in a table , but it is not working
for me and I am not sure if this method is possible
FlagBank is a field in the table Tbl_Temp Account Validation. The error
message is that the variable is not defined, where should I define it. Sorry
if this is basic but I am only new to the game.

Thanks


Private Sub Close_MDF_Click()
Dim intresponse As Integer
'Users chooses to update more members details or exit
intresponse = MsgBox("Do you want to update more members? ", vbYesNo,
"System Messenger")
Select Case intresponse
Case vbNo
DoCmd.Beep
DoCmd.Close acForm, "Frm_Members Details"
DoCmd.SetWarnings False
DoCmd.OpenQuery "Qry_Append form sent date to master record"
DoCmd.OpenQuery "Qry_delete Duplicate records from Tbl_Master Form Sent
date"
DoCmd.OpenQuery "Qry_Bank Validation delete temp"
DoCmd.OpenQuery "Qry_Bank Validation test 1"
DoCmd.OpenTable "Tbl_Temp Account Validation"
If FlagBank = 1 Then
DoCmd.OpenQuery "Qry_Bank Validation test 2"
DoCmd.RunMacro "Mcr_Send New members details"
DoCmd.OpenQuery "Qry_update new members with date"

Case Else
MsgBox "test incomplete please check Sort code and bank number"
'Case vbYes
'DoCmd.Close
'DoCmd.OpenForm "Frm_Members Details", acNormal, , , acFormAdd
'MsgBox "Previous Member has now been updated, you may continue",
vbInformation, "Easi Transfer DD System Messenger"
End Select

End Sub

--
Nadine



Any thoughts!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top