hockey8837
Registered User.
- Local time
- Today, 08:25
- Joined
- Sep 16, 2009
- Messages
- 106
Hi,
I've got DB which tracks Events and Contacts; i.e. contacts and the events they attended, and events and the contacts who attended them.
I based this form off of the Students DB Template Microsoft provides. I have 2 data forms, 'Contact Details' and 'Event Details', which the user can open, look at data directly about that, say, contact (like address, phone, etc), and also click on a tab to view a subform datasheet of all events the person has attended. Same setup for Events and a tab for all participants.
In both forms, a SELECT DISTINCT query runs off of the EventID or ContactID rowsource in the datasheet which allows the user to select events or contacts, respectively, that are already in the DB and add them to that list.
My issue is this: in the Contact Details form, if you go to enter into the events subform datasheet a NEW record (a new event not in the DB yet), a window prompts you saying this record is not in the DB and do you want to enter a new record. If you click YES, it opens the 'Events Details' to a new, blank form and you can enter away.
This is the code under the On Got Focus for this subform:
This is under On Dbl Click:
I've copied the same form for my 'Events Details' subform, to select contacts from the existing DB in order to track who was at the event the same way as above for contacts. So, I followed the same kind of setup as the 'contact details' subform, but changed the code under On Dbl Click to:
I get the prompt that the record is not in the DB, but it doesn't open a new, blank contact detail form. Do I need to change something else? I'm not sure where to go from here. Everything else about this form is working properly, just not this. I'm not sure how the [Screen].[ActiveControl] command works or what it is trying to call.
I'm using Access2007 and Windows XP.
Thanks!
I've got DB which tracks Events and Contacts; i.e. contacts and the events they attended, and events and the contacts who attended them.
I based this form off of the Students DB Template Microsoft provides. I have 2 data forms, 'Contact Details' and 'Event Details', which the user can open, look at data directly about that, say, contact (like address, phone, etc), and also click on a tab to view a subform datasheet of all events the person has attended. Same setup for Events and a tab for all participants.
In both forms, a SELECT DISTINCT query runs off of the EventID or ContactID rowsource in the datasheet which allows the user to select events or contacts, respectively, that are already in the DB and add them to that list.
My issue is this: in the Contact Details form, if you go to enter into the events subform datasheet a NEW record (a new event not in the DB yet), a window prompts you saying this record is not in the DB and do you want to enter a new record. If you click YES, it opens the 'Events Details' to a new, blank form and you can enter away.
This is the code under the On Got Focus for this subform:
Code:
[B]Condition[/B]- [Screen].[ActiveForm].[Name]=[Form].[Name][B]Action[/B]- Requery
[B]Arguments[/B]- =[Screen].[ActiveControl].[Name]
Code:
[B]Condition[/B]-IsNull([Screen].[ActiveControl])
[B]Action[/B]- StopMacro
[B]Action[/B]-OpenForm
[B]Arguments[/B]-Events Details, Form, , ="[ID]=" & [Screen].[ActiveControl], , Dialog
[B]Action[/B]-OnError
[B]Arguments[/B]-Next,
[B]
Action[/B]- Requery
[B]Arguments[/B]- =[Screen].[ActiveControl].[Name]
Code:
[B]Condition[/B]-IsNull([Screen].[ActiveControl])
[B]Action[/B]- StopMacro
[B]Action[/B]-OpenForm
[B]Arguments[/B]-Contact Details, Form, , ="[ID]=" & [Screen].[ActiveControl], , Dialog
I'm using Access2007 and Windows XP.
Thanks!