Results 1 to 3 of 3

Thread: This Should be Easy...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    28
    I've started working on my first MDI application. When it loads, I want it to set the database and recordsets so that they'll be accessible to all the child forms by name. So I've done this so far (the declarations are behind the MDI form, which is the project's start form):
    Code:
    Public db as database
    Public rs as recordset
    Public Sub MDIForm_Load()
    Set db=OpenDataBase("Path")
    Set rs=db.OpenRecordSet("name")
    End Sub
    Every thing's "public" right? So why can't the MDI's child forms "see" the recordset object, as in:

    Code:
    Public Sub Command1_Click()
    some_variable=rs.Fields!fieldname
    End Sub
    Which produces the all too troubling error 424. I'm sure it's simple, but I'm perplexed.

  2. #2
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    Check and double check your path. It looks right to me.

  3. #3
    Lively Member
    Join Date
    Mar 2000
    Posts
    87
    You have to reference the recordsets using the form name. So Form1.rs if thats where it is declared. Alternatively you can put the recordset and database declarations into a bas module and then you can just access them directly

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