P
Paul3rd
Hello,
I'm trying to match a form's RecordSource to a corresponding table.
The table has as it's name the current DATE.
When I try to open the form I get the following runtime error:
RunTime Error: -'2147467259 (80004005)
The database has been placed in a state by user 'Admin'
on machine 'XP2000' that prevents it form being opened or locked.
Private Sub Form_Open(Cancel As Integer)
Dim cat As ADOX.Catalog
Dim tbl As ADOX.Table
Set cat = New ADOX.Catalog
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & CurrentProject.Path & _
"\SPReleasev2.mdb"
For Each tbl In cat.Tables
If tbl.Name = Date Then
Me.Text31.Value = tbl.Name
Me.Form.RecordSource = tbl.Name
If tbl.Name <> Date Then
DoCmd.TransferDatabase acExport, "Microsoft Access",
CurrentDb().Name, _
acTable, "5/6/2007", Date, True
End If
End If
Next tbl
Set cat = Nothing
End Sub
I'd appreciate any help with this problem.
Thanks in advance,
Paul
I'm trying to match a form's RecordSource to a corresponding table.
The table has as it's name the current DATE.
When I try to open the form I get the following runtime error:
RunTime Error: -'2147467259 (80004005)
The database has been placed in a state by user 'Admin'
on machine 'XP2000' that prevents it form being opened or locked.
Private Sub Form_Open(Cancel As Integer)
Dim cat As ADOX.Catalog
Dim tbl As ADOX.Table
Set cat = New ADOX.Catalog
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & CurrentProject.Path & _
"\SPReleasev2.mdb"
For Each tbl In cat.Tables
If tbl.Name = Date Then
Me.Text31.Value = tbl.Name
Me.Form.RecordSource = tbl.Name
If tbl.Name <> Date Then
DoCmd.TransferDatabase acExport, "Microsoft Access",
CurrentDb().Name, _
acTable, "5/6/2007", Date, True
End If
End If
Next tbl
Set cat = Nothing
End Sub
I'd appreciate any help with this problem.
Thanks in advance,
Paul