VBA Code

dcollard23

Registered User.
Local time
Today, 04:33
Joined
Jun 15, 2009
Messages
87
I have a form with 6 checkboxes, a combo box to choose a state and datepickers..The results I am wanting will be obtain from 2 queries that are linked by a primary id (salesqry).
I want to be able to pull results based on the one or more checkboxes and state I choose between two dates. The names of my 6 checkboxes are: intialcontact, sentletter, recdinfoprod, sentsubpkg, recdsgndocs, completed.
Example: I check intialcontact checkbox on my form, I chose AZ between 10/01/09 to 10/20/09. Say I check initinal contact and sent letter for specific dates chosen and a state chosen. How do I go about writing VBA code to obtain results for different checkbox options chosen.
I hope that wasn't too confusing.
Thanks
elaine
 
I am fairly new to access 2003 so that website suggested is all foreign to me. I want to be able to choose more than one checkbox based on the state choosen and the dates chosen. I don't know if IIF statements in the query will do or not,,,
A bit of background. the users will input various data into the table,,,,I have 5 date columns and 5 columns that are checkboxes,,,,when the checkbox is check the current date auto fills. Example,,,the user chose initial contact so the checkbox is check and because the checkbox is check the column next to it titled date of initial contact prefills with the current date. Say I have 20 initial contact boxes checked therefore 20 date field are filled with various dates...I want to be able to run a report that say if I chose initial contact between 10/1/9 and 10/15/9 for the state of AZ I will obtain those results. I want to be able to select more than one box say I select Initial contact and sent letter between 10/1/09 and 10/15/9 for the state of AZ,,,I want to obtain those results. In the table the fields with checkboxes must be check to obtain results.
 
Lets backtrack a bit. I have a strong suspicion that your database isn't Normalized. I say this because:
A bit of background. the users will input various data into the table,,,,I have 5 date columns and 5 columns that are checkboxes
Two things immediately come to mind. First, you should never let the end user have direct access to the tables. Forms should be used to input data. Second, it sounds like you are treating a table like an excel spreadsheet. Access doesn't work that way.
If i'm off the concept, then I apoligize.

It sounds like you are looking to develop a contact database. You are looking to document every time an employee contacts someone. What you should be doing is storing each contact event in a separate table. Something like this:

tblContactEventDetail
ContactEventDetailID (Primary Key)
WhoIAmContactingID (Foreign Key - Relates to the person who you are contacting)
ContactDate
ContactTime
InitialContact (Yes/No Field)

Setup that way, you could easily run a query and tell the query to to give you all records where InitialContact = Yes. You could further filter it by date. And since the Person who was contacted is stored by their ID number, you could use that to filter by state.
 

Users who are viewing this thread

Back
Top Bottom