Results 1 to 2 of 2

#Name? in text box on form load with this code

  1. #1
    scott0_1 is offline Advanced Beginner
    Windows Vista Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    75

    #Name? in text box on form load with this code

    Hi all,



    I need to set the form record source and control control sources on form load as I'm using the same form to display different things. To keep things simple for now, I've got txtPayCentre on the form. this is my Form Load event:

    Code:
    strSQL = "SELECT PayCentre FROM tblExcelImportPayCentreTEMP"
    Me.RecordSource = strSQL
    Me.Requery
    txtPayCentre.ControlSource = Me!PayCentre
    The form is a continuous form and it recognizes that there are 11 entries in the table. The only problem is that txtPayCentre displays #Name? for each entry.

    I've also tried making a DAO recordset and doing the above, but no dice.

    Am I in the wrong event? Should I be in Form Open?

    Thanks,

    Scott

  2. #2
    scott0_1 is offline Advanced Beginner
    Windows Vista Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    75
    I took .controlsource out and it works fine. Huh.

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

Similar Threads

  1. Text justified on form load
    By Khaled2004 in forum Forms
    Replies: 1
    Last Post: 09-28-2017, 03:59 PM
  2. Replies: 13
    Last Post: 06-12-2015, 07:52 AM
  3. Replies: 12
    Last Post: 03-27-2014, 04:49 AM
  4. Can't trigger VBA code on form load
    By wardw in forum Programming
    Replies: 2
    Last Post: 08-30-2013, 12:58 PM
  5. Clear text box on form load
    By RoyLittle0 in forum Access
    Replies: 3
    Last Post: 03-05-2013, 05:40 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
  •  
Tech Forums: Microsoft Office Forums