andysgirl8800
Registered User.
- Local time
- Today, 12:14
- Joined
- Mar 28, 2005
- Messages
- 166
Hi all!
I'm looking for some help, but not really sure where to post this question. I want to put a button on a form (frmHalfTab)that runs a macro/module/ or VBA (not sure which will be the best approach) that will accomplish simultaneous tasks.
1) When clicked, I would like it to check the contents of one field (MBRDrug) with an "If" statement and auto-fill a second field (MBRDrugAlt) with the results of the "If" statement. For example, if the MBRDrug field says "Zocor 10MG" I want it to auto-fill the MBRDrugAlt with "Zocor 20MG". The drug names and their partner alternates are stored on a table (tblHalfTab1). I'm not sure how to build this "If" statement to use that table.
2) I then want it to check for a duplicate entry in the field MemberNum AND MBRDrug so that if member number 111 with the drug "Zocor 10MG" appears twice, a message box will appear saying something like "this member has already been contacted, do you wish to contact again?" and two buttons with "yes" or "no", clicking on "yes" will return to the form with no changes, clicking on "no" will check a box called MemberContacted.
3) Finally, I want to check for all records with MemberContacted unchecked, and merge them into an MSWord document/letter. I know how to do the merge, just not the check for the MemberContacted parameter.
Is this all possible to do with a single button, other than the pop-up interruption for duplicate records? I could really use some help in getting started. Maybe if I had a point in the right direction, I could figure it out on my own. Thank you all for your valuable wealth of knowledge!
I'm looking for some help, but not really sure where to post this question. I want to put a button on a form (frmHalfTab)that runs a macro/module/ or VBA (not sure which will be the best approach) that will accomplish simultaneous tasks.
1) When clicked, I would like it to check the contents of one field (MBRDrug) with an "If" statement and auto-fill a second field (MBRDrugAlt) with the results of the "If" statement. For example, if the MBRDrug field says "Zocor 10MG" I want it to auto-fill the MBRDrugAlt with "Zocor 20MG". The drug names and their partner alternates are stored on a table (tblHalfTab1). I'm not sure how to build this "If" statement to use that table.
2) I then want it to check for a duplicate entry in the field MemberNum AND MBRDrug so that if member number 111 with the drug "Zocor 10MG" appears twice, a message box will appear saying something like "this member has already been contacted, do you wish to contact again?" and two buttons with "yes" or "no", clicking on "yes" will return to the form with no changes, clicking on "no" will check a box called MemberContacted.
3) Finally, I want to check for all records with MemberContacted unchecked, and merge them into an MSWord document/letter. I know how to do the merge, just not the check for the MemberContacted parameter.
Is this all possible to do with a single button, other than the pop-up interruption for duplicate records? I could really use some help in getting started. Maybe if I had a point in the right direction, I could figure it out on my own. Thank you all for your valuable wealth of knowledge!