Hi all (and everybody else),
I'm a first time poster, long time post-reader....so be gentle please. This is a long message, but its always better to explain as much as you can to save others time (or so the theory goes).
I am in a quandary wondering how to fix this problem. I looked everywhere on this forum for an answer, but oddly enough, all I could find are posts where people want a customized error message when a duplicate record is found. Instead of a message, I would like the form to be able to go to the record that already exists. Here goes with the specifics of my problem:
I have a database with two forms,
Form Name | Bounded To?
--------------------------
1. Calendar | unbound
2. PhoneCalls | table named "Calls"
The Calls table only has one field, "Date". You can probably guess what data that field contains.
Here's what I've done already:
I have an unbound text field in the Calendar form. This text field is named "txtdate". When I click on a date in the calendar, the txtdate field is populated with the date. A command button becomes visible at the same time that allows me to create that date in another form (the PhoneCalls form). Here's the code....
-------------------------------------------------
Private Sub cmdEnter_Click()
DoCmd.OpenForm "PhoneCalls", acNormal
DoCmd.GoToRecord acDataForm, "PhoneCalls", acNewRec
Forms!PhoneCalls!Date = Forms!Calendar!txtpr
End Sub
-------------------------------------------------
Here's what I need help with:
1. Replace the code above with a code that looks for duplicates in the PhoneCalls form (or the Calls table). Again, this code is coming from the unbound Calendar form. If this setup needs to change, please let me know.
2. When a duplicate is found, I want the PhoneCalls form to go to the record with the date in question.
3. If a duplicate isn't found, have the form go to a new record ready for creation.
4. In case it makes a difference, my database exists in both Access 2000 and 2002.
Again, I tried looking at the other threads, but they just don't apply to me since they deal with forms that are both bounded and I haven't seen a thread where anyone wants to go to the record if it exists.
Thanks in advance for any attempts to solve my problem, I really appreciate it.
Scootman
I'm a first time poster, long time post-reader....so be gentle please. This is a long message, but its always better to explain as much as you can to save others time (or so the theory goes).
I am in a quandary wondering how to fix this problem. I looked everywhere on this forum for an answer, but oddly enough, all I could find are posts where people want a customized error message when a duplicate record is found. Instead of a message, I would like the form to be able to go to the record that already exists. Here goes with the specifics of my problem:
I have a database with two forms,
Form Name | Bounded To?
--------------------------
1. Calendar | unbound
2. PhoneCalls | table named "Calls"
The Calls table only has one field, "Date". You can probably guess what data that field contains.
Here's what I've done already:
I have an unbound text field in the Calendar form. This text field is named "txtdate". When I click on a date in the calendar, the txtdate field is populated with the date. A command button becomes visible at the same time that allows me to create that date in another form (the PhoneCalls form). Here's the code....
-------------------------------------------------
Private Sub cmdEnter_Click()
DoCmd.OpenForm "PhoneCalls", acNormal
DoCmd.GoToRecord acDataForm, "PhoneCalls", acNewRec
Forms!PhoneCalls!Date = Forms!Calendar!txtpr
End Sub
-------------------------------------------------
Here's what I need help with:
1. Replace the code above with a code that looks for duplicates in the PhoneCalls form (or the Calls table). Again, this code is coming from the unbound Calendar form. If this setup needs to change, please let me know.
2. When a duplicate is found, I want the PhoneCalls form to go to the record with the date in question.
3. If a duplicate isn't found, have the form go to a new record ready for creation.
4. In case it makes a difference, my database exists in both Access 2000 and 2002.
Again, I tried looking at the other threads, but they just don't apply to me since they deal with forms that are both bounded and I haven't seen a thread where anyone wants to go to the record if it exists.
Thanks in advance for any attempts to solve my problem, I really appreciate it.
Scootman