Solved No data entry after a certain time ? (1 Viewer)

bob fitz

AWF VIP
Local time
Today, 05:33
Joined
May 23, 2011
Messages
4,717
If you have a relationship, and your form/subform was created by the Wizard, moving to the subform, will not Automatically save the New record of the Parent form.
:unsure: I have never experienced that behaviour with a form bound to a table/query.
I should be interested to see an example if you have one.
 

bob fitz

AWF VIP
Local time
Today, 05:33
Joined
May 23, 2011
Messages
4,717
....... I always found that if i didn't include a save button, people would always ask for one. ........
If you feel it would be more aesthetically pleasing to your users you could leave the validation code in the form's BeforeUpdate event and have a button labeled "Save" which could be coded to move to a new record which I assume would be the next thing they would want to do and that record movement would cause Access to save the record and fire the validation code.

In the form's AfterUpdate event you could also have some validation code to inform the user if the child table/subform doesn't have least one record. I can't imagine many scenarios where you would want to create an order without anything being ordered.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:33
Joined
May 7, 2009
Messages
19,169
additional code to the subform
 

Attachments

  • Test1.zip
    35.4 KB · Views: 85

Emma35

Registered User.
Local time
Yesterday, 22:33
Joined
Sep 18, 2012
Messages
455
Sorry guys i've been under the weather a little for the last couple of days so haven';t checked the thread.
Thanks arnelgp. I had a look at your example but it still gives me the 'Booking confirmed' message before i even make a selection on the subform ?

bob...i know Save buttons are not necessary really but i've always found that with people who are not familiar with Access, it's nice to provide them with something which clears the record off the screen for the next User. The last database i created, i didn't include save buttons and got nothing but complaints about previous users leaving the form on the screen full of text. It's all a matter of personal choice i suppose.
 

bob fitz

AWF VIP
Local time
Today, 05:33
Joined
May 23, 2011
Messages
4,717
Emma
Try commenting out the code that arnelgp has in the Orders forms Before Update event .

EDIT
Glad to hear that you're feeling better, or perhaps you were just missing us ;):);)
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:33
Joined
May 7, 2009
Messages
19,169
is the subform function separate from the main form?
it does the same validation as the main form, no entry after 10 am.

listen to the old man :p
 

Emma35

Registered User.
Local time
Yesterday, 22:33
Joined
Sep 18, 2012
Messages
455
Ok i took the code off of the parent form and just used the subform code. It's working better now but when i try to select more than one item from the subform menu, the 'Booking Confirmed' message keeps popping up after every choice i make. Sorry if i've done something silly !

bob......of course i missed you all ;). You guys have dug me out of more holes than i care to remember (y)
 

Attachments

  • Test2.zip
    69.8 KB · Views: 90

bob fitz

AWF VIP
Local time
Today, 05:33
Joined
May 23, 2011
Messages
4,717
Ok i took the code off of the parent form and just used the subform code. It's working better now but when i try to select more than one item from the subform menu, the 'Booking Confirmed' message keeps popping up after every choice i make. Sorry if i've done something silly !

bob......of course i missed you all ;). You guys have dug me out of more holes than i care to remember (y)
Is the confirmation message really required and if so, when. Just after the first items or just when the order is completed
 

bob fitz

AWF VIP
Local time
Today, 05:33
Joined
May 23, 2011
Messages
4,717
arnelgp may have a better idea but does this work for you:
 

Attachments

  • Test2.accdb
    992 KB · Views: 89

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:33
Joined
May 7, 2009
Messages
19,169
check and test.
 

Attachments

  • Test2.zip
    75.3 KB · Views: 79

Emma35

Registered User.
Local time
Yesterday, 22:33
Joined
Sep 18, 2012
Messages
455
They both actually work well. Last thing (i know women are never happy)......if the booking is cancelled can i prevent the record from being saved in tbl_Orders. I could probably work around it but is there a line of code which would achieve the same result ?
 

bob fitz

AWF VIP
Local time
Today, 05:33
Joined
May 23, 2011
Messages
4,717
They both actually work well. Last thing (i know women are never happy)......if the booking is cancelled can i prevent the record from being saved in tbl_Orders. I could probably work around it but is there a line of code which would achieve the same result ?
Once you move the focus to the sub form the main form record is saved by Access. You could delete the record though, or perhaps better would be to add "cancelled" field to the orders table.

BTW My wife is always happy but then she would be. She's got me:cool::LOL:
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:33
Joined
May 7, 2009
Messages
19,169
you can have a "Cancel" button on the form to delete the record.
 

Emma35

Registered User.
Local time
Yesterday, 22:33
Joined
Sep 18, 2012
Messages
455
Good suggestions thanks a lot guys. I'll work something out.....it's not a major issue anyway. Thanks again for all the help i appreciate it very much

bob.......your Access abilities are surpassed only by your modesty 😉
 

Emma35

Registered User.
Local time
Yesterday, 22:33
Joined
Sep 18, 2012
Messages
455
Just my penny.... Isn't it much easier to have all choices in a single (unbound)form? Like use a non-visible combo / listbox that becomes visible after the timecheck? I think this is a very complicated way to get a result.
I'm really sorry i completely missed your post. Thank you for the suggestion
 

bob fitz

AWF VIP
Local time
Today, 05:33
Joined
May 23, 2011
Messages
4,717
Good suggestions thanks a lot guys. I'll work something out.....it's not a major issue anyway. Thanks again for all the help i appreciate it very much

bob.......your Access abilities are surpassed only by your modesty 😉
Thank you for your kind words. There'll always be someone here to help you if you need it :)
 

Users who are viewing this thread

Top Bottom