Results 1 to 9 of 9
  1. #1
    mercapto is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Location
    Spain
    Posts
    91

    Assign a value to multiple records in a totals query

    I assume this task has to be made through vba, so I'll place my question in here.

    I have to fill the same value for 30-40 records that belong to the same client (and again for other clients).



    As usual, the totals query doesn't allow me to edit any field. So I figured a continuous form showing a short list of my clients, with an independent field in which I fill the value and, through code, this value is asigned to all records belonging to the same client.

    As many of you should know right now, independent fields are not a good deal in a continuous form. A field in the recordset is necesary to record the data. The issue is that I "can't" store data in the field because it's a totals query.

    Any ideas??

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Quote Originally Posted by mercapto View Post
    I have to fill the same value for 30-40 records that belong to the same client (and again for other clients).
    Till some one comes along,
    Is above within the same table ?

    Thanks

  3. #3
    mercapto is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Location
    Spain
    Posts
    91
    Yes, it is in the same table. But the where condition comes from a table bounded to another table that is bounded to the referred table:
    ANALYSIS REPORT - SAMPLE ORIGIN - CLIENT
    Thanks.

  4. #4
    mercapto is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Location
    Spain
    Posts
    91
    No one?? Any alternatives?

  5. #5
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    I am not really understanding your intent. However if I do understand some of it. You could have a total query tied to combo box. Then use an expression in your main forms query row source. Like totvalue:dlookup("fieldname","query name","Id=" & forms!formname!comboname )

    this way you will have an updatable source with the total in it.

    you could use a subquery as well.. but not sure if your comfortable with that.

    Hope this helps.

  6. #6
    mercapto is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Location
    Spain
    Posts
    91
    Thanks, alcapps.
    I must explain that when I say "totals query", I really mean a query with many "group-byes". I am not calculating any value.
    Actually, what I want to do is to store the date where I present my work to a certain client. Since I have many works (records) that are presented to only one client the same day, I believe this task should be automatized. I also want this form to control which works have not been presented yet. That's why I want a continuous form.
    Alcapps, I don't understand how a combo box could help me, the issue is in the input field, I don't know how to input this date, because neither independent, nor dependent fields are working.

    I already tried subqueries. I thought It was going to work, but it didn't...

    Sorry for my english.

  7. #7
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    yes so if you had a combo box with your clients in it you could use that as the key to create your records.

    you would do an update query using the combo box as you criteria and change the dates.

    sql = "update table set date field = #" & date from text box & "# where clentID =" & me.combobox

    hope this helps

  8. #8
    mercapto is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Location
    Spain
    Posts
    91
    All right, allcaps, but I still can't figure out how to enter the date. Unless I use one only field, with one only combo as you describe. And that's not what I am looking for, as I said, I want to have a view of all the records. In a continuous form, with the procedure you described, I will still have the same problem with the date field.

    ... And while I am writing this lines I am having the idea to use a listbox rather than a combobox!! This way I could perform it as you suggested, and having a view of al my records.

    It could work... I'll be back.

  9. #9
    mercapto is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Location
    Spain
    Posts
    91
    It did work.

    I used a lisbox and placed a text below to capture with dblclick the record I want to edit. Afterwards, I can run any query with code using the data in the listbox and entering the date individually for every record.

    It's not what I asked, but is what I wanted. Solved.

    Thanks.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Auto Assign ID to new records
    By swadson in forum Access
    Replies: 8
    Last Post: 09-10-2012, 01:37 PM
  2. Replies: 2
    Last Post: 08-15-2012, 11:42 AM
  3. Assign Unique IDs to Multiple Tags
    By willbmisled in forum Queries
    Replies: 1
    Last Post: 02-02-2011, 10:11 PM
  4. Replies: 42
    Last Post: 07-13-2010, 02:49 PM
  5. Replies: 7
    Last Post: 12-07-2009, 07:27 AM

Tags for this Thread

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