The cmdAdd / Nested 'If' Selection structure..

FantasiaDown
09-09-2003, 09:09 AM
[hello!]

So i recently started on a brand new project which incorporates the use of designing and construction of a voting appplication that will be used.
I am half way finished, but i am having problems with properly coding the cmdAdd btn on an Add frm. On this Add frm, the user is required to input the personal info of a resident of the home and then the information is then to be input into the database and their vote to be tabulated later on.

the txtboxes (which i've already finished) for this addfrm require the following information :
LastName
FirstName
Address
Apartment Number
City
Province
Postal Code
...and then also an additional large txtbox i've labelled as "Memo :" for
any other additional information that may be important in regards to the owner of the house.

I'm thinking that i am first going to have to open a sequential file for this information to be sent to, but after that, i am not too sure what to do and i have not come up with any code thus far.the first thing i know that i must do, is to provide code so that all of the required information is indeed correct before writing it to an output file.

any help on this matter would be quite appreciated.
thanks !

Garmour
09-09-2003, 09:19 AM
You mention a database but then go on to talk about a sequential file... which is it ?

Basically, you are asking for the code to validate each item of data.

You can 'validate' the data in your 'Confirm' button.
ie, your addfrm form has all of the textboxes for dataentry and a button to OK the dataentry.

All you can really do is check to ensure that the textbox is not empty

if lastname.text = "" then
msgbox "You need to enter a LastName"
lastname.setfocus
exit sub
endif


This is a simplistic approach.

You can also get software to allow for postcode matching to allow you to confirm the address is valid.

FantasiaDown
09-09-2003, 09:45 AM
[hey there]

I said sequential file and the use of a database because after the information has been added, eventually, there will be the desire to open the file and look at the informaion regarding the resident of the house.
the application i have to design is voters database.
i hope this clears up that question a bit.

the suggestive code you gave me, i actually figured out a while ago. thank you though. i appreciate the help with that so far.

i'm sure i'll write more





You mention a database but then go on to talk about a sequential file... which is it ?

Basically, you are asking for the code to validate each item of data.

You can 'validate' the data in your 'Confirm' button.
ie, your addfrm form has all of the textboxes for dataentry and a button to OK the dataentry.

All you can really do is check to ensure that the textbox is not empty

if lastname.text = "" then
msgbox "You need to enter a LastName"
lastname.setfocus
exit sub
endif


This is a simplistic approach.

You can also get software to allow for postcode matching to allow you to confirm the address is valid.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum