Hello all,
I am relatively new to Access but am getting really in to this VBA. I just have a quick question about 'DIM' in code.
I programmed a button so 'on click' it performed its function and at the end it asks the user if they would like to open another database. I used to the following code:
msgbox ("Would you like to run the Availabilty?", VBYesNo, "Export Finished")
If vbyes = true then
Shell etc etc.....
Else
End if
Now quite clearily this doesn't work and after consulting my VBA for dummies it turns out that it needed to be something along the lines of:
DIM answer as Integer
Answer = MsgBox("Would you like to run the Availabilty?", VBYesNo, "Export Finished")
If answer = VByes then
Shell etc etc.....
My question is, what exaclty is the DIM function doing? Looking at other code it seems fundamental to VBA and yet I cant get my head round its purpose. I would be grateful if someone could explain this to me??
Thanks,
Finchy!
I am relatively new to Access but am getting really in to this VBA. I just have a quick question about 'DIM' in code.
I programmed a button so 'on click' it performed its function and at the end it asks the user if they would like to open another database. I used to the following code:
msgbox ("Would you like to run the Availabilty?", VBYesNo, "Export Finished")
If vbyes = true then
Shell etc etc.....
Else
End if
Now quite clearily this doesn't work and after consulting my VBA for dummies it turns out that it needed to be something along the lines of:
DIM answer as Integer
Answer = MsgBox("Would you like to run the Availabilty?", VBYesNo, "Export Finished")
If answer = VByes then
Shell etc etc.....
My question is, what exaclty is the DIM function doing? Looking at other code it seems fundamental to VBA and yet I cant get my head round its purpose. I would be grateful if someone could explain this to me??
Thanks,
Finchy!