Results 1 to 9 of 9
  1. #1
    hilian is offline Advanced beginner
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    44

    Question Populate subform text box

    I’m trying to populate a text box on a subform (frmEpisodes) with information from a combo box on the main form. The combo box is called cboIntpLanguage; the information, the rate charged for an hour of interpretation, is in the third column. The text box is called txtIntpRate. When I use this code



    Me!frmEpisodes.txtIntpRate = Me.cboIntpLanguage.Column(2)

    I get the error message “Object doesn’t support this property or method." What am I doing wrong?

    Thanks,

    Henry

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    Henry -

    You could try...

    [Forms]![MainFORMName]![frmEpisodes].form![txtIntpRate] = [Forms]![MainFormName]![cboIntpLanguage].Column(2)

    Replace [MainFormName] with the name of your main form. This is the long version for illustrative purposes.

    All the best,

    Jim

  3. #3
    hilian is offline Advanced beginner
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    44
    Hi Jim, I tried the following code:

    [Forms]![frmIntpCases]![frmEpisodes].Form![txtIntpRate] = [Forms]![ frmIntpCases]![cboIntpLanguage].Column(2)

    Unfortunately it didn't work. I got this error message:

    OPTAReports can’t find the form ‘frmIntpCases’ referred to in a macro expression or Visual basic code.

    Thanks,

    Henry

  4. #4
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    Henry -

    Is the main form open? Double check the spelling of the name of the Main Form. Also, what is "OPTAReports?"

    Jim

  5. #5
    hilian is offline Advanced beginner
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    44
    The main form is open. I checked the spelling of everything. It was all correct. OPTAReports is the name of the DB. Actually the name of the DB is OPTAReorts Interp, but Access apparently truncated it. the db tracks interpretation services provided in a number of languages. Each language has a different rate.

  6. #6
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    Henry -

    Don't know if this is a copy and paste issue but, there is a space in the code...
    [Forms]![frmIntpCases]![frmEpisodes].Form![txtIntpRate] = [Forms]![_frmIntpCases]![cboIntpLanguage].Column(2)

    Remove space and see if that helps.

    Jim

  7. #7
    hilian is offline Advanced beginner
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    44
    I removed the space, but that didn't work.

    Thanks,

    Henry

  8. #8
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    Henry -

    If the form is open and the form's name is spelled correctly and the error continues, it may be necessary to provide DB for analysis. However, in the interim, try...

    dim frmCurrent as Form
    Set frmCurrent = Screen.ActiveForm
    MsgBox "The name of the current form is: " & frmCurrent.Name
    '[Forms]![frmIntpCases]![frmEpisodes].Form![txtIntpRate] = [Forms]![frmIntpCases]![cboIntpLanguage].Column(2)
    'See if the MsgBox returns "frmIntpCases"

    Jim

  9. #9
    hilian is offline Advanced beginner
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    44
    Jim,

    Thank you for the code. I tried it, but it still gave me the error message. I had a sanitized version of the db that I created to solve another problem. I decided to first try the original code with this version, and it worked. Evidently there was something in my db that was interfering with the code running. No way of knowing what it was, but I'm going to rebuild the db using the sanitized version as a starting point. I'll do that on Monday if I can get to it. If it still gives me problems, I'll ask for help again.

    Thank you for all your help so far,

    Henry

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

Similar Threads

  1. Replies: 2
    Last Post: 06-11-2012, 09:37 AM
  2. Populate a subform with data
    By intransit2 in forum Forms
    Replies: 1
    Last Post: 03-06-2012, 07:33 PM
  3. Replies: 3
    Last Post: 10-01-2011, 02:21 PM
  4. Replies: 8
    Last Post: 05-17-2011, 04:41 PM
  5. Populate table/subform from VBA
    By degras in forum Forms
    Replies: 3
    Last Post: 03-03-2011, 10:59 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