Results 1 to 6 of 6

Thread: [RESOLVED] Get Property List

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2009
    Location
    Townsville, Qld, Australia
    Posts
    135

    Resolved [RESOLVED] Get Property List

    I've seen lists (usually on a spreadsheet) of a form with its name and properties and the names and properties of all the objects in that form. I assume there is an easier way than copy and paste to get such a list! What is it?

    Thanks

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Get Property List

    I've got no idea how to detect a list of properties, but the names of objects should be fairly easy:
    Code:
    Dim varControl as Variant
      For Each varControl in Me.Controls
         MsgBox varControl.Name
      Next varControl
    If it doesn't work, try changing Me to the name of the form.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2009
    Location
    Townsville, Qld, Australia
    Posts
    135

    Re: Get Property List

    That wasn't quite what I had in mind although it could also be useful. See attached file (I didn't create it) for an example of the sort of thing I want. (A quick way of converting the data back to a form would also be handy.)
    Attached Files Attached Files

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Get Property List

    I'm afraid I have no idea what you want... that doesn't seem to have anything to do with the question you asked.

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Get Property List

    i looked at the form, there is nothing in that in relation to your original question,

    if you want to put all the details of the forms controls etc
    Code:
    Begin VB.Form frmInvoice 
       BackColor       =   &H00808000&
       Caption         =   "Form1"
       ClientHeight    =   9150
       ClientLeft      =   165
       ClientTop       =   855
       ClientWidth     =   9645
       LinkTopic       =   "Form1"
       ScaleHeight     =   9150
       ScaleWidth      =   9645
       StartUpPosition =   3  'Windows Default
       Begin VB.CommandButton cmdClear 
          Cancel          =   -1  'True
          Caption         =   "CLEAR"
          Height          =   495
          Left            =   7200
          TabIndex        =   9
          Top             =   6360
          Width           =   2055
       End
       Begin VB.CommandButton cmdExit 
          Caption         =   "EXIT"
          Default         =   -1  'True
          Height          =   495
          Left            =   7200
          TabIndex        =   10
          Top             =   7200
          Width           =   2055
       End
    into a spreadsheet, just open the .frm for input as if it was a .txt and fill a range
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jun 2009
    Location
    Townsville, Qld, Australia
    Posts
    135

    Re: Get Property List

    Ah, I fiddled around a bit more and discovered that the answer to my problem was File > Export File. Sometimes the solution to a problem is asking the right question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width