S
Serena
Hi there
I have an existing database that I inherited which
contains a lump of code (I suspect) copied from Northwind -
code below. I need to split the database so that in the
future I can make front-end changes easily but the code
now falls over at the Set MyLogin statement with run-time
error 3251. Apparently (KB287638) you can't use SEEK
directly on linked tables but instead need to open an
external connection to the back-end and then use SEEK
directly on the table - can someone please tell me how I
do this 'external connection'.
Any assistance would be much appreciated.
Cheers
Serena
Private Sub LogButton_Click()
Dim LogData As Database
Dim stDocName As String
Dim stLinkCriteria As String
Dim MyLogin As Recordset
Dim UserResponce
Dim MyControl As Control
Set LogData = CurrentDb
Set MyLogin = LogData.OpenRecordset("Login",
dbOpenTable)
With MyLogin
.Index = "PrimaryKey"
MyLogin.Seek "=", Me![LoginID]
If MyLogin.NoMatch Then
Set MyControl = Me![LoginID]
UserResponce = MsgBox("Login ID not found",
vbExclamation, "Login Validation")
MyControl.SetFocus
Else
If Me![PassWord] = MyLogin![PassWord] Then
If MyLogin![Supervisor] = True Then
stDocName = "Switchboard1"
Else
stDocName = "Switchboard2"
End If
I have an existing database that I inherited which
contains a lump of code (I suspect) copied from Northwind -
code below. I need to split the database so that in the
future I can make front-end changes easily but the code
now falls over at the Set MyLogin statement with run-time
error 3251. Apparently (KB287638) you can't use SEEK
directly on linked tables but instead need to open an
external connection to the back-end and then use SEEK
directly on the table - can someone please tell me how I
do this 'external connection'.
Any assistance would be much appreciated.
Cheers
Serena
Private Sub LogButton_Click()
Dim LogData As Database
Dim stDocName As String
Dim stLinkCriteria As String
Dim MyLogin As Recordset
Dim UserResponce
Dim MyControl As Control
Set LogData = CurrentDb
Set MyLogin = LogData.OpenRecordset("Login",
dbOpenTable)
With MyLogin
.Index = "PrimaryKey"
MyLogin.Seek "=", Me![LoginID]
If MyLogin.NoMatch Then
Set MyControl = Me![LoginID]
UserResponce = MsgBox("Login ID not found",
vbExclamation, "Login Validation")
MyControl.SetFocus
Else
If Me![PassWord] = MyLogin![PassWord] Then
If MyLogin![Supervisor] = True Then
stDocName = "Switchboard1"
Else
stDocName = "Switchboard2"
End If