Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by astraltango

  1. astraltango

    Checking whether a form, referenced in a form variable, is loaded

    Thanks for your suggestions but I ended up simply using the following function: Function formIsOpen(formVar As Form) As Boolean On Error GoTo Exit_formIsOpen Dim tempStr As String formIsOpen = False tempStr = formVar.Name formIsOpen = True Exit_formIsOpen: Exit Function...
  2. astraltango

    Checking whether a form, referenced in a form variable, is loaded

    How can I check that a form is open using the variable: public formVariable as Form After formVariable is assigned, I realise I could use: isLoaded(formVariable.Name) but this would only check if an instance of the form is loaded, ie it may be a different instance of the form referenced in...
  3. astraltango

    Passing a reference to a subform

    yeah, it's working now, cheers
  4. astraltango

    Passing a reference to a subform

    if I declare the public variable in a standard module I get the error: "compile error. invalid use of property" if I declare the public variable in form1, I get the following error when the variable is updated: "run-time error '91': Object variable or With block variable not set"
  5. astraltango

    Passing a reference to a subform

    I have a parent form that has a subform (subForm1) that opens a form (form1) form1 then needs to reference subForm1 form1 is opened by multiple forms, so I can't hardcode the reference to subform1 in form1 I want to declare a public variable (callingFormVariable) in form1 (or as a global)...
  6. astraltango

    dynamically updating variable in different form

    ok, I have two forms: Form1 and Form2 I want to set a puiblic variable (str1) in Form1 from Form2. Works fine if I use the following: Forms!Form1.str1 = "blah" BUT, I need to do this dynamically where the form name is in a variable. For this I need the eval function right? But this does...
  7. astraltango

    initialization of database connection in VB

    How do I initialize a connection to my Access Database in VB? eg, how would I initialize cnMyDB to use in: cnMyDB.Execute("Select Value from Table where key=2") Cheers
  8. astraltango

    Storing value from sql query

    thanks heaps, exactly what I need
  9. astraltango

    Storing value from sql query

    cheers vb5prgrmr, have read faq now I have discovered that all I require is the use of DLookup
  10. astraltango

    Storing value from sql query

    I want to run an SQL query to get a value from a table and store the result in a variable for further use. How do I do this? eg "select field1 from table1 where key = 121" may return one record: "fred" which I wish to store in a variable I have found the following code in...
  11. astraltango

    Storing value from sql query

    not quite what I'm after, I actually want to store in the variable a field value returned from the SQL query ie, query may return "fred" which I want to store for later use I have since found the following code in another thread, but I'm still a little confused: Set rsMyValue =...
  12. astraltango

    Storing value from sql query

    I want to run an SQL query to get a value from a table and store the result in a variable for further use. How do I do this? eg "select field1 from table1 where key = 121" Cheers
  13. astraltango

    Use of global variables

    ah yes, I wasn't including the form name when referencing the variable is there any other way to reference a global variable without specifying a specific form? (since that is defeating the purpose of using the public variable in the first place) thanks again
  14. astraltango

    Use of global variables

    I'm simply trying to set a global variable which is set by one form and accessed by another, but it is not working. I have declared it as public in the first module, but don't seem to be able to access it in another module. Any idea what I may be doing wrong? I have tried declaring it as...

Part and Inventory Search

Back
Top