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

Table or Query? 1

Status
Not open for further replies.

xoymas

Technical User
Jun 6, 2001
34
US
Hi guys I'm new to access2000 and I have a table where I have a students table with complete info in several columns and one of these has a column that is named Major. The majors are listed for each student but the "undecided" is not written down and the cell was left empty. Is there a way to have these empty cells be filled with "undecided" without typing this word for every field?
I'll appreciate the answer.Thanks
 
Run an update query. Select this field and in the Update To section type your value. In the criteria section for the field type Is Null.

Good luck...

B-) ljprodev@yahoo.com
ProDev
MS Access Applications
 
Hi thanks for answering my question. I typed everithyng as suggested but when I run the query I get only the column named "Major" and is empty. The rest of the columns like names etc don't show up, and are also erased from the design view.
 
Did you actually run the query or you just viewed it? From the toolbar, click Query and then Run!
 
When you actually run the query, click the red exclamation point on the menu bar. As far as the other fields, if they are not doing anything like sorting or being used to filter records, then they will disappear from the grid of an Update query. It only keeps essential information in the grid.

Let me know how you come out. ljprodev@yahoo.com
ProDev
MS Access Applications
 
Hi Thanks for your time I erased the old the copy and started all over to see the results and it is still giving me the "Major" cell empty. It did not erase the rest of the columns this time though.This is more or less how I have the table and query.
FirstName LastName Major StudentId
albert perks business 10001
tom tellk chemistry 10002
jerry olson 10003
peter carry 10004
jhon cassiny business 10005
I want to have the word "Undecided" to come out where the fields are empty either in the table or the query.
I hope I'm not overdoing it and I again thank you for your time.
 
In your query design, did you select update query? This is done by selecting the Query Type icon on the menu bar. It is next to the Run Query button (red exclamation point). Once you have the grid for an Update Query, select the Major field on put it on the grid. You should have a section labled "Update To". Here is where you would put "Undecided". In the criteria section you would put Is Null. Then run it by clicking the Red exclamation point.

In order to catch the ones in the future you could...

1. Set the default value for this field in the table to be "Undecided" in the tables proper window.

2. You could put code in the form's after update event that to put Undecided if it is left blank...

If IsNull(Major) Then
Major = "Undecided"
End If

Just a couple of suggestions. Let me know how you come out.

B-) ljprodev@yahoo.com
ProDev
MS Access Applications
 
Hi I'm back It worked but I tell you I had to do it doing different try outs. The program I have in my computer is not working properly because it is supposed to do it the first time. It did not want to work the way it is supposed to and after I put the text on the two cells I got a message saying It will update the files but! I had t this point to close the query without saving it and after rerunning it it worked fine.It put undecided where it was suppposed to and if you check back on the design view none of the criteria I put is there since I did not save it.Where it might be? I closed access and reopened it again and it worked fine.Thank you very much with your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top