Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To verify data while entering into the DB from Forms 2

Status
Not open for further replies.

rushitshah

Technical User
Joined
Jul 22, 2005
Messages
29
Location
US
Hi Ppl,
I am very new to Access 2003. I am building up an application that requires data entry into the tables from forms.

I have couple of doubts,

1. After closing the form when I open it again, it shows the data of the table, I do not want that. I want that when opened the form it should be blank, not showing anything from the tables.

2. I want to verify the data before it is entered in to tables. As in some fields are mandatory and required to be in some specific format, to check that. If they are not proper then generate some warning to the person.

3. Is it possible to put a button or something on the form that when that is clicked only then the data is transferred to the table. Usually when I enter the data in the form at that time only it transfers to the table. But I do not want that.

If someone can reply to these questions that will be a great help. Thanks..
 
did you click the button?

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
yes. I clicked the button.

after opening the form, I kept data in both the text boxes and hit the button, so the data entered in to the table.

Now both the textboxes are empty. If I hit the button at this time, it adds blank record, it is not generating the error message.

Shouldn't it run the onclick button event each time the button is hit?

It looks like it is working only once and then it is not checking the validation part.

Rushit..
 
I think when you moved the validation inside the click, the 'old' code was used, so just replace the:
if isnull(me.Text0) then

with:
if isnull(me.Text0) or me.text0 = "" then


After the first save, there is code that sets the text0 field to "".

"Hmmm, it worked when I tested it....
 
got it Trev..
Thanks..
By the way can you guys refer a very basic good book for VBA coding for Access 2003??

Rush..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top