Results 1 to 6 of 6
  1. #1
    msr71 is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    17

    Applications.CreateControl

    When ever I include the last two parameters width and height for a textbox the textbox does not show:



    Set ctlText = CreateControl(frm.Name, acTextBox, acDetail, "", "", dblTxtLeft, dblTxtTop, dblTxtWidth, dblTxtHeight)

    Any assistance, advice or solution will be greatly appreciated.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    why are you creating controls in code? you shouldn't be doing that. I've never seen a situation where that was needed.

  3. #3
    msr71 is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    17
    What I am trying to do is create a Data Entry Form that looks like this:

    Math Bio Chem
    Mark 98 95 96
    Mary 75 69 54
    John 52 75 86

    The values of columns and rows come from database tables and the user enters grades in the textboxes that make up the table cells. I will handle the Inserts and updates with ADO.

    I have another approach but I find it not to be as elegant as using the CreateControl method.

  4. #4
    msr71 is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    17
    I have since discovered that the TextBox is being created but with a Width of 0 and a Height of 0.0007

  5. #5
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by msr71 View Post
    I have since discovered that the TextBox is being created but with a Width of 0 and a Height of 0.0007
    then you're probably getting your argument measurements confused between inches and TWIPS.

    read about twips in the help menu, vba. very extreme methods like 'createcontrol' use twips. as a matter of fact, I believe all methods via vba in access that require a unit of measurement in height and width use twips.

  6. #6
    msr71 is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    17
    Thanks AJ that was not a detail that I considered. I tried it and it worked. I've also learnt all the controls whose height and width are in TWIPS.

    I will never forget this.

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

Similar Threads

  1. How to use one DB file in many other DB applications ?
    By cement in forum Database Design
    Replies: 4
    Last Post: 01-01-2011, 05:50 AM
  2. Killing open applications using VBA
    By zippy483 in forum Programming
    Replies: 4
    Last Post: 03-03-2010, 10:04 PM
  3. Replies: 0
    Last Post: 11-14-2009, 07:37 AM
  4. Front ends apps in split applications
    By Coolpapabell in forum Access
    Replies: 4
    Last Post: 10-14-2009, 01:51 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