Ladies/Gentlemen,
As a newbie, I've obviously come to the internet to try and find the answer to my problems. I've been trying to crack this by trial and error, but my VB code just isn't good enough. I know what I want to say, but Access isn't having any of it!
Basically, I'm trying to create a search form, in which the user can select a field to search, and then type the search criteria, hit a button and away we go. There are only 8 field and 1 table. I have the search fields listed in a combo box, all assigned a unique identifying number, hidden from view, but nonetheless in the combo box.
The code I want to write sounds, in my head, like:
IIf([searchfield].Number = 1, RunMacro "searchdate")
IIf([searchfield].Number = 2, RunMacro "searchtype")
Does any guru know whether I'm going about this the wrong way? Tried as many different variations as I can but cannot seem to get the button to access the number assigned in the combo box.
I'm entering the information into the "on click" box on the properties of the button command, but I've also got a feeling that this is the wrong place to put code that is a bit more complex. Can anyone give any pointers?
Many thanks,
Dave
As a newbie, I've obviously come to the internet to try and find the answer to my problems. I've been trying to crack this by trial and error, but my VB code just isn't good enough. I know what I want to say, but Access isn't having any of it!
Basically, I'm trying to create a search form, in which the user can select a field to search, and then type the search criteria, hit a button and away we go. There are only 8 field and 1 table. I have the search fields listed in a combo box, all assigned a unique identifying number, hidden from view, but nonetheless in the combo box.
The code I want to write sounds, in my head, like:
IIf([searchfield].Number = 1, RunMacro "searchdate")
IIf([searchfield].Number = 2, RunMacro "searchtype")
Does any guru know whether I'm going about this the wrong way? Tried as many different variations as I can but cannot seem to get the button to access the number assigned in the combo box.
I'm entering the information into the "on click" box on the properties of the button command, but I've also got a feeling that this is the wrong place to put code that is a bit more complex. Can anyone give any pointers?
Many thanks,
Dave