Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Question How to fill many records with some value at a time?

    How to fill many records with some value at a time?



    please, see the attached screen shot that shows my question

    i wanted to fill some value for many record in Field2.

    how can i do that? do i need to fill them one by one?

    regards

    Jamal

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    You don't have to do it manually.

    What rows do you want to put the new value in Field2?
    All rows?
    Only specific rows?

  3. #3
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Question

    Quote Originally Posted by Robeen View Post
    You don't have to do it manually.

    What rows do you want to put the new value in Field2?
    All rows?
    Only specific rows?
    Thank you Robeen for the answer.

    i wanted to put a new value for specific records (selected ones) at a time as shown in screen shot.

    For example, in ArcGIS software, we can add some value for the selected records at a time.

    how can we do the same in Access?

    regards

    Jamal

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Are you wanting to put the same value into all your selected records?

    What value in each record will let us know that this is a record into which you want to add a value in another field?

  5. #5
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Question

    Quote Originally Posted by Robeen View Post
    Are you wanting to put the same value into all your selected records?

    What value in each record will let us know that this is a record into which you want to add a value in another field?
    For example, i need to add the same "city" for all the selected records, and in this case, all the selected records in the Field2 will take the value "Ramallah"

    is it possible in Access to fill the value "Ramallah" (same value) for all selected records at a time (all together)?

    regards

    Jamal

  6. #6
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Yes - it IS possible to fill a value - like "Ramallah" - into as many records as you want - at the same time.

    BUT

    You have to tell Access WHICH rows you want that value put into.

    For instance - if you wanted to put City = "Ramallah" into all rows of data where there is no value in the 'City' field you can run an INSERT query that looks something like this:

    Insert into [TableName](City) Values ("Ramallah") Where [TableName].[City] Is Null

    However - if all rows that you want to put City = "Ramallah" into don't have anything in common with each other [like all are Null in the City field, or some other common value in all the rows] - then you cannot do this.

  7. #7
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Question

    Quote Originally Posted by Robeen View Post
    Yes - it IS possible to fill a value - like "Ramallah" - into as many records as you want - at the same time.

    BUT

    You have to tell Access WHICH rows you want that value put into.

    For instance - if you wanted to put City = "Ramallah" into all rows of data where there is no value in the 'City' field you can run an INSERT query that looks something like this:

    Insert into [TableName](City) Values ("Ramallah") Where [TableName].[City] Is Null

    However - if all rows that you want to put City = "Ramallah" into don't have anything in common with each other [like all are Null in the City field, or some other common value in all the rows] - then you cannot do this.
    Sorry for the confusion in this thread.

    please, see the screen shot that shows my question

    in filling the a database table, it happens that many records in Field1 have the same value in Field2. in this case, do i need to fill the records of Field1 that have the same value in Field2 one by one?

    is this practical?

    regards

    Jamal

  8. #8
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Wait . . .

    Your last screenshot shows Table13 that HAS cities and Table12 does not.

    Are you asking me if you can copy and paste the values from one Table to another?
    OR
    Are you asking if it is possible to put values in using an INSERT query?

    I'm sorry. It is difficult for me to understand because of the language.

  9. #9
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Question

    Quote Originally Posted by Robeen View Post
    Wait . . .

    Your last screenshot shows Table13 that HAS cities and Table12 does not.

    Are you asking me if you can copy and paste the values from one Table to another?
    OR
    Are you asking if it is possible to put values in using an INSERT query?

    I'm sorry. It is difficult for me to understand because of the language.
    Thank you Robeen.

    It frequently happens that we can't express what we need to do and this is why i try to attach screen shot in each single post.


    Suppose that we have Table13 as Hard Copy! and we need to fill its value in table12. In this case, we have 6 records that to have the value "Ramallah" and other 2 values that have the value "Hebron".

    my question: what is the best way to fill the Table12 with these values?

    do we need to copy and paste the value "Ramallah" 6 times? and the value "Hebron" two times?

    this question is all about data entry!

    appreciated

    regards

    Jamal

  10. #10
    A S MANN is offline Advanced System Analyst
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    India
    Posts
    164
    Down load the attached DB
    The task can be very easily done by Update query as shown in your own data base
    Run the update query to duplicate the data from Table13 to Table12.
    Study the update query properly
    Hope this will solve your problem.

  11. #11
    jamal numan is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Thumbs up

    Quote Originally Posted by A S MANN View Post
    Down load the attached DB
    The task can be very easily done by Update query as shown in your own data base
    Run the update query to duplicate the data from Table13 to Table12.
    Study the update query properly
    Hope this will solve your problem.
    Thank you MANN. this is very useful.

    regards

    Jamal

  12. #12
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Jamal said that Table 13 was in hard copy:
    Suppose that we have Table13 as Hard Copy! and we need to fill its value in table12.
    . . . I assume 'Hard Copy' to mean . . . 'on paper'.
    But the screenshot shows Table 13 already in the database.

  13. #13
    jamal numan is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Question

    Quote Originally Posted by Robeen View Post
    Jamal said that Table 13 was in hard copy:

    . . . I assume 'Hard Copy' to mean . . . 'on paper'.
    But the screenshot shows Table 13 already in the database.
    You are right Robeen.

    What i made is just a sample of what we may have in Hard Copy"! Just to illustrate the idea behind my thread.

    many thanks

    regards

    Jamal

  14. #14
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    In that case, you have two options.

    1. Use an update query for each value you want to add to your table12.
    Eg:
    I created a query top update Table1 in your DB using this SQL.
    Code:
     
    UPDATE Table1 SET Table1.[Field2] = "Ramallah" 
    WHERE Table1.[ID] In (1009,1209)
    It put "Ramallah" in Field2 of the first two records of the Table.
    You can put in many more IDs in there - so that you can fill more fields at once.

    Or you can try this [which will update Field2 in the first 4 rows of Table1 with "Ramallah":

    Code:
     
    UPDATE Table1 SET Table1.Field2 = "Ramallah"
    WHERE Table1.[ID] Between 1009 AND 1598;
    OR

    You can Copy & Paste - but it will be tedious.
    First Type Ramallah in one field.
    Then Copy it and paste it in the next field.
    Then select both fields that have Ramallah.
    Then paste THAT into two more fields . . .

    . . . good luck!!!
    I hope you don't have a LOT of this to do.

    Using the Update should be a lot quicker - I think - but you'll still have to put all the criteria [either the 'in' - or the 'Between' values] into the query.

    I hope this helps!!

  15. #15
    jamal numan is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Thumbs up

    Quote Originally Posted by Robeen View Post
    In that case, you have two options.

    1. Use an update query for each value you want to add to your table12.
    Eg:
    I created a query top update Table1 in your DB using this SQL.
    Code:
     
    UPDATE Table1 SET Table1.[Field2] = "Ramallah" 
    WHERE Table1.[ID] In (1009,1209)
    It put "Ramallah" in Field2 of the first two records of the Table.
    You can put in many more IDs in there - so that you can fill more fields at once.

    Or you can try this [which will update Field2 in the first 4 rows of Table1 with "Ramallah":

    Code:
     
    UPDATE Table1 SET Table1.Field2 = "Ramallah"
    WHERE Table1.[ID] Between 1009 AND 1598;
    OR

    You can Copy & Paste - but it will be tedious.
    First Type Ramallah in one field.
    Then Copy it and paste it in the next field.
    Then select both fields that have Ramallah.
    Then paste THAT into two more fields . . .

    . . . good luck!!!
    I hope you don't have a LOT of this to do.

    Using the Update should be a lot quicker - I think - but you'll still have to put all the criteria [either the 'in' - or the 'Between' values] into the query.

    I hope this helps!!
    Clever work a round Robeen. Useful notes to follow. Many thanks.

    regards

    Jamal

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Count records between Time Period
    By turnbuk in forum Queries
    Replies: 1
    Last Post: 08-10-2011, 10:06 AM
  2. Replies: 2
    Last Post: 08-09-2010, 06:34 AM
  3. Replies: 5
    Last Post: 03-30-2010, 12:53 PM
  4. Calculate Time and Display Records
    By w2vijay in forum Reports
    Replies: 1
    Last Post: 02-12-2010, 01:58 AM
  5. Replies: 0
    Last Post: 08-04-2009, 09:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums