home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

NewB database lookup question...

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2143
Discussions: 200,950, Posts: 2,379,420, Members: 246,311
Old October 11th, 2002, 02:45 PM   Digg it!   #1 (permalink)
Senior Member
 
saladbarkid's Avatar
 
Join Date: Apr 2002
Location: TechIMO
Posts: 544
Question
NewB database lookup question...

I have an Access database that's an address book with a lookup (dropdown box). When a letter is typed in, it goes right to the last names that start with that letter.

If the correct name is found and clicked on, all the info is displayed in the corresponding text boxes.

What I would like to know is - when I enter a last name that is NOT in the list, I want to be able to push 'enter' and have the last name drop from the lookup box to the last name text box and create a new file in the list with that last name. I don't want to use an 'add new record' button either.

If a better explanation is needed, I will post again.

I don't know SQL so this is kinda tricky for me...

Thanks for the help.
saladbarkid is offline   Reply With Quote
Old October 13th, 2002, 07:53 PM     #2 (permalink)
Member
 
Join Date: Oct 2001
Location: Midland, NC USA
Posts: 64
Mostly depends on how you have the columns in your "people" (for lack of a better name) table defined. If none of the columns are required, you can insert a row in the database with just the last name populated and retrieve the row for display just as if the last name were already in the list.
The trick is not so much an issue of SQL programming, but of letting your proggy know when to do the insert. Especially since you don't want specific input from the user (an "add new" button") to trigger the event.

You seem to have logic there already to try to retrieve a row from the database when the user clicks on a name in the list. Since the "new" name won't be in the list, the user can't click on the name there to fire the query.

You could add logic to the onclick event of the name entry box to check for the length of the contents of the entry box and, if not zero, query the DB for the name and insert a row, retrieve it, and display the results (just a last name and all the other bozes empty.

Thing is, the logic for the onclick event in this case would be the same as the onclick event for an "add new" button. Either way, the user needs to do SOMETHING to trigger the insert. It would be more intuitive for the user to have an "add new" button available to click on.

Then you have the issue of the logic needed to trigger updating the row in the database with whatever the user enters in the "empty" boxes. The user needs some means to let you know that the entries are ready to be committed to the database. Either an "update" button (more intuitive on the user's part) or logic that commits the data entered when the user starts keying something else in the query box or goes somewhere else. If you try to do this automagically in the background, you'll need some mechanism for the user to indicate that the entries made to the "empty" record may need to be discarded instead of committed to the database.

Using buttons for let the user indicate what action (add, update, ignore) is wanted is a lot more user-friendly than trying to programmatically second-guess the user. And it puts you quite a bit closer to knowing that the data being saved in the database is valid.
UncaDanno is offline   Reply With Quote
Old October 13th, 2002, 10:28 PM     #3 (permalink)
Senior Member
 
saladbarkid's Avatar
 
Join Date: Apr 2002
Location: TechIMO
Posts: 544
Well, I would have liked the user to be able to enter the name in the lookup box, and if the (last) name isn't in there, just press enter and that cuts the last name and pastes it into the last name field adding a new row to the database for the user to add the rest of the fields. That is what I would idealy like.
__________________
20" iMac 2.16GHz / 1GB RAM / 250GB HDD / 8x DVDRW / OS 10.5
saladbarkid is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Making Health Care Worse (176)
Is It Just Me? (2940)
The disrespect of Obama by Russian .. (26)
Wireless Televisions. (12)
windows 7 problem (7)
CPU fan stops spinning randomly (8)
Regular Build (6)
radeon x850xt platinum & shader.. (6)
Is the PSU I received dead? (12)
Print spooler problem (15)
HIS HD5770 graphic card question (15)
Install XP pro and a Vista laptop ?.. (11)
windows vista security holes (9)
Dept. of HS: NSA 'Helped' Develop V.. (15)
Recent Discussions
Ideal cheap graph card for PC-Gaming? (18)
radeon x850xt platinum & shader 3 (6)
Graphics Card Upgrade Question (4)
Happy Thanksgiving: At discount from .. (0)
Multiple Restarts Required at Boot (1)
For Sale BFG GTX285 OC2 with 10 year .. (3)
Point and Shoot Camera Suggestions. (3)
How to convert MP3's (4)
Wireless Televisions. (12)
Laptop with wireless problem. (2)
Internet Lost (1)
Hp Artist Edition + Matching Bag (0)
My monitor won't turn on after instal.. (0)
Asus P4G8X Mobo (6)
Xbox 360 GTA: SA disk error (1)
Is the PSU I received dead? (12)
windows 7 internet problem (5)
BSOD On Startup (ntoskrnl.exe) (2)
Print spooler problem (15)
Have you switched yet? (86)
screen resolution vs monitor size (2)
sms storage to PC (0)
Regular Build (6)
Open With ..... Win7 (0)
java code for fibonacci (1)


All times are GMT -4. The time now is 10:56 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28