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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form with SQL DB

Status
Not open for further replies.

thisismatt

Technical User
Jul 18, 2003
5
GB
Guys

I'm trying to create a form to use on our intranet that, when opened, it checks the user's network logon. If it exists in the DB, the user is presented with their personal information to check (name, phone number, manager, etc...) and then to proceed if all correct or after making amendments. Once they click proceed, this page should close and fire up a new window (retaining their personal data for later use).

That much I can do, BUT, what I also need is that if the user's ID is NOT found within the DB, the same form needs to be presented, but with empty fields for the user to complete. All fields must be mandatory (no Javascript validation). Once complete, the user clicks proceed and data is saved to the DB, new window fires open (as above) and the 'user info' window closes.

Like I say, I can do part 1 fairly easily, but it's the second bit that's really foxing me.

HELP!! lol

Thanks in advance.

Matt
 
You could likely leave your form pretty much the same without making any major changes. If the UserID exists, then you set the values of each field equal to the respective data from your recordset. If there is no data in the recordset (e.g., recordcount = 0), then the fields will still be blank.

Then, at the bottom where you would presumably have a button that will take you to the update/add page, you have it do update if the UserID does exist, else do an add if the UserID doesn't exist.

If you need additional help with this, perhaps you could post some of the relevant code and we can help from there.

------------------------------------------------------------------------------------------------------------------------
"The major difference between a thing that might go wrong and a thing that cannot possibly go wrong is that when a thing that cannot possibly go wrong goes wrong it usually turns out to be impossible to get at or repair."
--Dou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top