Avatar billede bsn Forsker
06. februar 2019 - 18:28 Der er 7 kommentarer og
1 løsning

Fokus ved flere databaser

Jeg laver et system med flere databaser - starter anden database fra første database - skal så have fokus på den nystartede anden database …
Det driller ...
Har i et bud ...

Office 2003 Pro...
Avatar billede terry Ekspert
06. februar 2019 - 19:15 #1
while your here, could you look at the two questions you have from 2017 too ;-)
Avatar billede bsn Forsker
07. februar 2019 - 00:31 #2
Ups...sorry, har afsluttet dem...
havde du et tip...???
Avatar billede terry Ekspert
07. februar 2019 - 09:38 #3
How are you opening the second dB?
Avatar billede bsn Forsker
08. februar 2019 - 00:15 #4
Opens from a cmdbtn

Call Journal

Public Function Journal()

    Dim strDB As String

' Initialize string to database path.
    Const strConPathToSamples = "C:\Banjul hospital\"
    strDB = strConPathToSamples & "Journal.mdb"

' Create new instance of Microsoft Access Application.
    Set appAccess = CreateObject("Access.Application")

' Open database in Microsoft Access window.
    appAccess.Visible = True
    appAccess.RunCommand acCmdAppMaximize
    appAccess.OpenCurrentDatabase strDB

' Open Form
    appAccess.DoCmd.OpenForm "frmJournal"
   
End Function
Avatar billede terry Ekspert
08. februar 2019 - 09:32 #5
Your actually very close to getting it right ;-)

If you open the dB first, make it visible and then maximize it should work.

' Open database in Microsoft Access window.
    appAccess.OpenCurrentDatabase strDB
    appAccess.Visible = True
    appAccess.RunCommand acCmdAppMaximize
Avatar billede bsn Forsker
08. februar 2019 - 17:45 #6
Not working - same result...focus on first db…:(
Avatar billede terry Ekspert
09. februar 2019 - 18:42 #7
That's strange. There isn't further code setting focus back on the first dB?

If I try your original code then it doesn't work, after changing code to opening dB first then it does work.
Avatar billede bsn Forsker
11. februar 2019 - 00:33 #8
Strange - yes...
Use another solution...

Open db2
Close db1

Close db2
Open db1
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester