Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reference Form Value in Another Database

Status
Not open for further replies.

benderulz

IS-IT--Management
Nov 2, 2010
43
US
Can anyone tell me how to reference a form value in another database?

For example

If db1.form.value = True then
'do this in db2
else
end if

Thanks
 
note a form does not have a value property

how about
Code:
Set AccessApp = GetObject(DBPath, "Access.Application")
msgbox accessapp.forms("formname").controlname
 
Sorry, my sample above didn't really explain what I was attempting. I currently have the user side check for a file, and if the file does not exist Access closes the form that connects them to db1 so I can Compact/Repair. However, I was hoping there was a way to just check a form box in db1 and receive the same result.

Function lck()
'form in db1
If Forms!Locked.LockBox.Value = True Then
'in db2
docmd.openform "CollectorCompactRepair"
Else

End Function
 
how about
Code:
Function lck()
Set AccessApp = GetObject(DBPath, "Access.Application")
msgbox accessapp.forms("formname").controlname
'form in db1
If accessapp.Forms!Locked.LockBox = True Then
'in db2 
     docmd.openform "CollectorCompactRepair"
Else

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top