473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
1 2614
ADezii
8,834 Expert 8TB
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

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

Similar topics

8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
3
by: Chris | last post by:
Hi, I'm trying to append text from another class to a generic richTextBox that I've added to a Windows form. I can't seem to figure out how to expose the richTextBox to append text to it. ...
2
by: afatdog | last post by:
Form1: //----------------------------------------------------------------- public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.TextBox textBox1; private...
3
by: Casper | last post by:
Hi .Net experts, I am trying to build a user control of textbox and would like to add a public method to the object like public void CheckOptions(string str) { // codes here }
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
6
by: Rudy | last post by:
Hi all, I know this is easy, just can't seem to get it. I have a windows form, and a text box, with a value already in it. I need to add that value to a table. It's just one value, so the entire...
4
by: Francis | last post by:
Hello i have a continuos form, and i have a command button to help insert information on a control textbox. But when the text box is not null, i dont want the command button to show (to the current...
6
by: polocar | last post by:
Hi, I'm writing a program in Visual C# 2005 Professional Edition. This program connects to a SQL Server 2005 database called "Generations" (in which there is only one table, called...
2
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.