Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111

    Unanswered: External database

    I opened a 2nd .mdb from a 1rst one, using the function:

    fOpenRemoteForm "c:\xis\a.mdb", "abc"

    Now the problem is:
    how make a reference into a field in that 2nd .mdb, instead using:

    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "abc"
    stLinkCriteria = "[NDossier]=" & "'" & Me![NDossier] & "'"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Thank you for your ideas.

    Note: The above function can be found here:
    http://www.mvps.org/

    Regards
    Ruas

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580

    How about

    Using a linked table/s from the second DB in the first?
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111

    Re: How about

    Saying the problem in the other way:

    In the actual database if I want make a reference into a field, I write:

    Me.text or forms!a!text

    If I had a second opened database, how can I make a reference into a field in that form and in that database from the first opened database?

    That's it...

    Thank you

    Jose Ruas

  4. #4
    Join Date
    Nov 2003
    Posts
    267
    Are you wanting to reference a form that exists in a different database? Why?

    S-

  5. #5
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111
    Your question makes me think... but let me explain my problem:

    1. My database needs to be updated and I must create 16 new forms.
    2. I think: I'll create a new database for that
    --- Am I thinking right?

    3. This second database uses information that refers always to someone that has its ID in the first one.

    [NOTE: If I want to open a form bringing the information from a specif data - in a single database, the code is:
    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "MyDocName"
    stLinkCriteria = "[Dossier]=" & "'" & Me![Dossier] & "'"
    DoCmd.OpenForm stDocName, , , stLinkCriteria]

    4. And now, how can I make it refering to the new database?

    ----

    If there is another approach I'll be glad to ear from you an idea.

    Thank you.

    Jose Ruas

  6. #6
    Join Date
    Nov 2003
    Posts
    267
    When I design a Access Database I always seperate the tables from the interface(forms,queries,reports). This may not be the best, but it works for me. I generaly program all my forms in the ONE (interface) DB that is links to the Other (Data) DB. Occasionally I need a second interface DB, but I treat it as a seperate interface and will capture what I need in that interface (IE ID). It makes it easier for my to program, and generally it is easier for the user, because there is set rules for them to following when using the program.

    Don't know if this helps you, but it works for me.

    S-

  7. #7
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111
    In the first database I have tables separated from the interface.

    In the second one, the same. The problem is not with tables. All this works fine. I can open the second database and access all information.

    The problem is - by code - looking for something in the second's form database.

    To look for something in a single database all we need is to write the name of the form and the field. Ex.: forms!clients!name

    But in this case, to look for something in the second database - from the fisrt one, we need something more than that. We need to write first the name of the second database and then the name of the form and then the name of the field.

    It looks like ist's not possible with Access.

    Here is the question.

    Thank you for all.

    Jose Ruas

Posting Permissions

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