Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form RecordSource From Exter Secured DB (Access 97)

    Hi Everyone,

    Both DB1 and DB2 are Access 97 DBs.

    DB1 - Security is set. User has no permissions to use tables. Users access the tables by queries RWOP.

    DB2 - Security is set. Different workgroup file.

    From within DB2 using the - Dim dbe As PrivDBEngine - I access records from a table utilizing the users RWOP in DB1 by - Set rst = dbs.OpenRecordset("EditRecords") and build a table and report from the records returned by the query.

    While in DB2, sometimes there is a need to edit records in DB1. When the user is in DB1 the user uses "qry_EditRecords" to edit records.

    My question - is it possible from within DB2 to use "qry_EditRecords" from DB1 as the recordsource for a form in DB2?

    Me.RecordSource = rst and db!Forms![MyFormName].RecordSource = rst - Doesn't work. I get a Type Mismatch error. Access doesn't like .RecordSource.

    Hope this make since.

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form RecordSource From Exter Secured DB (Access 97)

    I can't help you with your main question, but I can explain the Type Mismatch error message you get.

    The RecordSource property of a form is of type String, not of type Recordset. It can be the name of a table, or the name of a query, or a SQL string. I doubt whether it can be the name of a query in another database, but I hope others will help you with that.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Form RecordSource From Exter Secured DB (Access 97)

    Forms in Access 97 do not have an exposed Recordset property, so there is no way to open a recordset in 97 and then pass it into the form, even if the data is from the current database..
    Charlotte

  4. #4
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form RecordSource From Exter Secured DB (Access 97)

    Thanks for responding Hans and Charlotte.

    From your posts forms do not have a rst property but, "It can be the name of a table, or the name of a query, or a SQL string."

    Any ideas on a naming convention as to how from the OnOpen Event of the form in DB2, I can let the form know that I am using the query from DB1.

    I tried Me.RecordSource = dbs.QueryDefs("qry_EditRecords") Type mismatch.

    Thanks

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form RecordSource From Exter Secured DB (Access 97)

    Again, the RecordSource property is of type string - it must be the name of a table or query (or a SQL string), not a recordset, nor a tabledef, nor a querydef. You get a type mismatch because dbs.QueryDefs("qry_EditRecords") is of type DAO.QueryDef, not of type string.

    The syntactically correct way would be Me.RecordSource = "qry_EditRecords", but this still won't work if qry_EditRecords is not a query in DB2. I think you will have to create a query in DB2 an use the name of that query. The query can return records from DB1, but it must "live" in DB2.

  6. #6
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form RecordSource From Exter Secured DB (Access 97)

    Hi Hans,

    I wasn't being dense. Bad example.

    Thanks again.

Posting Permissions

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