Results 1 to 9 of 9
  1. #1
    Traceyann1964 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    23

    Error autopopulating form

    Hi I have a form with a combobox which autopopulates fields such as name and address.

    I am going to add a subform which will calculate values for an invoice. I want the main form to be blank when I open it so I therefore need to set the main form properties to data entry (yes)

    As soon as I set the data entry to yes, the fields no longer auto populate.
    Frustrating as I have done this before on a previous database so I know it can be done. Any ideas what I am doing wrong?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    yes, you can autopopulate, but after starting a new record, you MUST save record with the Client key.
    It cant populate the sub form data until the key is saved.

  3. #3
    Traceyann1964 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    23
    Many thanks for your help. I am just a novice and don't quite understand. I wonder if you could explain further? Ive no idea about coding etc. Thanks in advance

  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
    Sorry, but when you set Data Entry to Yes, the Records you're trying to retrieve, using the Combobox and the third option, don't exist, as far as the Form is concerned! Open the Form, with Data Entry to Yes, and look at the Navigation portion of the Form...instead of saying

    Record 1 of n

    where n is the number of Records in the underlying Table...it will always say

    Record 1 of 1

    Set Data Entry back to No and use this code to move to a New Record (which will be blank) when opening the Form:

    Code:
    Private Sub Form_Load()
      DoCmd.GoToRecord , , acNewRec
    End Sub

    Linq ;0)>

  5. #5
    Traceyann1964 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    23
    Thanks for your help but it didnt work.
    I have a combobox to autofill name and address, vehicle make and model which works perfectly. I then plan to add a subform to allow the user to add values for an invoice so each time the form is opened it will techinally be a NEW invoice so needs to be a data entry from. I added the code DoCmd.GoToRecord , , acNewRec in the "on load" property but it hasnt worked

  6. #6
    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
    Have you set Data Entry Property of the Main Form to No? Despite its name, Data Entrydoesn't need to be set to Yes to enter data...it means you can only enter New Records, not view/edit existing Records.

    Linq ;0)>

  7. #7
    Traceyann1964 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    23
    Thank you for your reply. Yes it is set no. Maybe something else in the form is wrong. I just want the form to open with no data showing. The user will then choose a customer from the combobox and it will autofill the customer name, address etc then from the subform, the user will add the invoice details so technically, the user wont be entering data into the form (only the subform) but they will still need to select the customer from the combobox. Hope thats not confusing

  8. #8
    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
    Only other suggestion I have is to zip up your file and attach it here for us to look at. If you can save a copy in format for an earlier version than 2010 I can look at it; barring that, I'm sure someone else will be happy to do so.

    Linq ;0)>

  9. #9
    Traceyann1964 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    23
    Thanks. I have attached it. Please bear in mind I am a complete novice and may well have errors elsewhere but its a practice database for my Son -in-Law's company. The form I am having problems with is FrmRaiseInvoice. I would like the user to be able to select the customer from a dropdown box as in FrmExistingInvoice so opening up as a blank form. The subform which I have only just added to the FrmRaiseInvoice isnt working either as its asking me for the Customer ID. Thanks in advance
    Attached Files Attached Files

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

Similar Threads

  1. Replies: 3
    Last Post: 12-17-2013, 05:14 AM
  2. Replies: 4
    Last Post: 03-22-2013, 10:58 AM
  3. Help with autopopulating a form
    By chulo in forum Forms
    Replies: 7
    Last Post: 02-20-2012, 03:57 PM
  4. subform not autopopulating
    By slimjen in forum Forms
    Replies: 32
    Last Post: 09-21-2011, 01:55 PM
  5. Autopopulating Forms
    By daniel.e.john in forum Access
    Replies: 3
    Last Post: 09-09-2011, 07:19 PM

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