Results 1 to 5 of 5
  1. #1
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188

    Convert text file frm to a functional form

    I'm working on another MS Access / Quickbooks process. In the sample files I was given the below code in a text file: ShowItems.frm.
    Is there a way to import the below into MS Access and create the form? Or otherwise a way to create the form?

    Thanks!



    Code:
    VERSION 5.00
    Begin VB.Form ShowItems 
       Caption         =   "Items List"
       ClientHeight    =   4530
       ClientLeft      =   60
       ClientTop       =   345
       ClientWidth     =   7065
       LinkTopic       =   "Form1"
       ScaleHeight     =   4530
       ScaleWidth      =   7065
       StartUpPosition =   3  'Windows Default
       Begin VB.CommandButton Done 
          Caption         =   "Done"
          Height          =   375
          Left            =   2880
          TabIndex        =   1
          Top             =   3960
          Width           =   1095
       End
       Begin VB.TextBox ItemsList 
          Height          =   3015
          Left            =   240
          MultiLine       =   -1  'True
          ScrollBars      =   2  'Vertical
          TabIndex        =   0
          Top             =   720
          Width           =   6375
       End
       Begin VB.Label Label1 
          Caption         =   "Query result for the first 30 items in the current company file."
          Height          =   255
          Left            =   240
          TabIndex        =   2
          Top             =   240
          Width           =   5895
       End
    End
    Attribute VB_Name = "ShowItems"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = False
    '----------------------------------------------------------
    ' ShowItems.frm
    '
    ' This form is simply used to display items which are
    ' returned from QuickBooks.  All interaction with QB
    ' takes place in the Main Module.
    '
    ' Last Updated: 08/2002
    '
    ' Copyright © 2002-2013 Intuit Inc. All rights reserved.
    ' Use is subject to the terms specified at:
    '      http://developer.intuit.com/legal/devsite_tos.html
    '
    '----------------------------------------------------------
    
    
    Private Sub Done_Click()
        Unload Me
    End Sub

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    you can use vba to create forms (but only if your db is .accdb and executed in a full version of access).

    see these links
    https://docs.microsoft.com/en-us/off...ion.createform
    https://docs.microsoft.com/en-us/off....createcontrol

    you would need to parse through your text file to determine the various properties

    But with just 4 controls, would be quicker just to create it manually

  3. #3
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188
    What are the 4 controls? Not knowing VB I'm not understanding what should be on the form.

    Thanks!

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    controls have properties similar to vb, you'll need to translate them to access. some will have the same name (e.g. width, top, height), some will be equivalent or you'll need to do some vba magic to get the equivalent

    without know what the form is supposed to do, difficult to suggest anything else

    if you are looking for an easy answer, I don't believe there is one

    on closer examination, there may only be 3 controls, a button, a textbox (or perhaps its a list box) and a label. the rest appear to relate to the form

  5. #5
    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
    Quote Originally Posted by Ajax View Post

    ...controls have properties similar to vb, you'll need to translate them to access. some will have the same name (e.g. width, top, height), some will be equivalent...
    Also know that while some objects, commands, etc. have the same names...they do not do the same things in both languages!

    Quote Originally Posted by Ajax View Post

    ...if you are looking for an easy answer, I don't believe there is one...
    I agree with that...you can't simply import the VB code into Access and create a Form. If you're versed in VB code, you can use that provided code as a guide, but you're really going to have to basically create your Form from scratch.

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

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 10
    Last Post: 08-24-2017, 05:24 AM
  2. Replies: 4
    Last Post: 06-24-2017, 05:12 PM
  3. Replies: 9
    Last Post: 08-25-2015, 12:35 PM
  4. Replies: 14
    Last Post: 04-10-2012, 06:37 AM
  5. Replies: 2
    Last Post: 07-21-2011, 08:57 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