Results 1 to 5 of 5
  1. #1
    Surreall is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Oct 2012
    Posts
    28

    Struggling with saving autofill

    Hi all,

    I have two tables, Customer Details and Jobsheet table

    I have created a form that populates the jobsheet table. I used combobox to get the customerid from the customer table. And then in the other fields on the jobsheet form i use
    Code:
    =[Combo819].[column](4)
    To get each column from the combobox.

    Now when i save the form. The jobsheet table updates with the next jobsheet, but all of the autofill fields are empty in the table.



    I have read up about afterupdate...and tried this

    Code:
    Private Sub Title_AfterUpdate()
    Me.Title = Me.Combo819.Column(3)
    End Sub
    Where Title is the name of the text box where the autofill is. And Combo819 is the combo box (that has lots of columns). But the jobsheet table isnt updating. Is this cause the combo box is looking at a different table?

    Regards

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    No. If Title is Bound to a Field in the underlying Table, it should be updating.

    After you placed this code in your Form, did you go to the Control Source Property for Title and change it from

    = Me.Combo819.Column(3)

    to

    Title

    or whatever the actual name of the Field is in the Form's RecordSource?

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Surreall is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Oct 2012
    Posts
    28
    Thankyou for replying.

    I am confused, if i change the Control Source property for title to
    Code:
    Title
    Then when i chose the drop down, the title text box doesnt update with anything?

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    After you've changed the Control Source to the underlying Field, you'd then have to use the Combobox again to populate the Field on any Records you've already entered. The Textbox was Unbound, so any thing previously entered is gone. It will only write data to the Table after you've set the Control Source to the Title Field.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Surreall is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    28
    Hehe i just get more and more confused lol (really sorry)

    I have one drop down box. That is linked to the Customer Tables. That i use to select the company name.
    I have another text box, called "Title" that looks at the 3rd column in the combo box above. With this code in the source box, =[Combo819].[column](3).

    So when i chose a company name from the drop down box (called company name on the form). The Title box automatically populates itself with the Title of the contact eg "Mr"

    But when i save the form the text box that automaticcaly updated with "Mr" (after choosing from the drop down box above it) doesnt save Mr in the table "Jobsheets"

    So i tried putting the below code in the Title text box in "after update option"
    Code:
    Private Sub Title_AfterUpdate()
    Me.Title = Me.Combo819.Column(3)
    End Sub
    So when i made your suggestion above in the source code for Title text box. It no longer updates when i chose the drop down in the box above

    Does that make sense?

    Regards

    PS i know i am not explaining well, Access is very very new to me

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

Similar Threads

  1. New to access and struggling
    By Erica Nichols in forum Reports
    Replies: 3
    Last Post: 03-28-2012, 03:02 PM
  2. Struggling with random ratings
    By EBDoom in forum Queries
    Replies: 5
    Last Post: 03-20-2012, 02:52 PM
  3. Still struggling with relating tables
    By djclntn in forum Database Design
    Replies: 31
    Last Post: 02-14-2012, 02:08 PM
  4. My first Database, struggling a bit
    By ravihotwok in forum Access
    Replies: 1
    Last Post: 12-07-2011, 05:17 AM
  5. struggling with query, plz help
    By jimgros in forum Queries
    Replies: 2
    Last Post: 07-26-2011, 03:35 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