• Form RecordSource From Exter Secured DB (Access 97)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Form RecordSource From Exter Secured DB (Access 97)

    Author
    Topic
    #384556

    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

    Viewing 1 reply thread
    Author
    Replies
    • #660158

      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.

      • #660276

        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

        • #660278

          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.

          • #660284

            Hi Hans,

            I wasn’t being dense. Bad example.

            Thanks again.

    • #660208

      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..

    Viewing 1 reply thread
    Reply To: Form RecordSource From Exter Secured DB (Access 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: