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

Auto fill blanks in a table with queried info

Status
Not open for further replies.

bitterman99

Technical User
Mar 10, 2006
19
US
Hello,

I have a query I am running that has a field labeled "user ID". Some of the fields are blank and some are not. What I am trying to do is fill in all the blank user ID fields with the user ID that comes across in the query. All the records should have the same user ID so I need to basically fill in the ones that are blank. I have tried an auto lookup and and an IIf formula but nothing works. I don't think this should be this complicated. Any help?

Thanks!
 
if you want to update a field of a table you can use an update query where the userid = userid

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
I would like to update the blank fields with the same User ID that is in the non-blank fields.
 
All the records should have the same user ID
Something like this (SQL code) ?
Code:
UPDATE yourTable
SET [User ID] = DLookUp("[User ID]", "yourTable", "Trim([User ID] & '')<>''")
WHERE Trim([User ID] & '') = ''

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You want to update the table with the information or you just want the query to "show" a userid if there isn't one?

the question is Update the table or show the data in the query and your response was:

I would like to update the blank fields with the same User ID that is in the non-blank fields.

Where in your response did you actually answer that question?

Glad, PHV could help, he (correctly) guessed that you wanted to update the table.

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top