By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,669 Members | 2,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,669 IT Pros & Developers. It's quick & easy.

Adding new record in a form if required textbox is not null

P: 57
Hi,

I'm working on a database that has a form which hold all of our products testing. each product can hold more than 1 complete test (complete test here means that product has to have before and after standard tests)
This database is created in access 97. The form has 2 portion which is "before standard test" and "after standard test". What I need is when user does product test, user has to enter before and after standard tests textboxes. If "after standard test" textbox is null, then user can't add another new complete test. I added the add button that check this criteria, and it's working fine. But the problem now is on the bottom of the form, it shows a record selector that user can just click to view next record or to add new record without clicking the add record button. I tried changing the allow addition property to no, but when I tried it, it won't show the test form if the product has not been tested yet or if user want to do test for the first time. could you please let me know on how to show record selector only to view next record if there's any without letting user adding new record? Hope it's not too confusing.

Thank you
Jun 15 '07 #1
Share this Question
Share on Google+
1 Reply


ADezii
Expert 5K+
P: 8,607
Hi,

I'm working on a database that has a form which hold all of our products testing. each product can hold more than 1 complete test (complete test here means that product has to have before and after standard tests)
This database is created in access 97. The form has 2 portion which is "before standard test" and "after standard test". What I need is when user does product test, user has to enter before and after standard tests textboxes. If "after standard test" textbox is null, then user can't add another new complete test. I added the add button that check this criteria, and it's working fine. But the problem now is on the bottom of the form, it shows a record selector that user can just click to view next record or to add new record without clicking the add record button. I tried changing the allow addition property to no, but when I tried it, it won't show the test form if the product has not been tested yet or if user want to do test for the first time. could you please let me know on how to show record selector only to view next record if there's any without letting user adding new record? Hope it's not too confusing.

Thank you
  1. Why not simple set the Required Property of both Fields to Yes? The User will not be able to advance to a New Record unless both Fields contain valid data.
  2. Try moving the validation code to the BeforeUpdate() Event of the Form. If your condition is not met, set Cancel = True.
Jun 15 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.