P
Piri
Access 97
I am trying to create a table in a local mdb from data in a table in
another mdb, without actually linking the two.
Is this possible?
I have tried the code below using the .Execute and the DoCmd.RunSQL
without success.
The error message I get with both these methods is:
..Execute = <3111-Couldn't create;no modify design permission for
table or query 'tblNewData' >
DoCmd.RunSQL = <3078-The Microsoft Jet database engine could not find
the input table or query 'tbldata'. Make sure it exists and that its
name is spelled correctly.>
The table certainly does exist.
Any help gratefully appreciated.
Piri
What I am asking for is all the data in a table called 'tbldata' in an
mdb called data.mdb located in //dataserver/data/ directory where the
Serial Number matches [SN2Check] but excludes the JobID of
[ParentJob], and place that data into (create) table called
[tblNewData ] in the local MDB.
Dim dbsTrack As Database, DataLocation as String
Dim strSQL As String
DataLocation = "//dataserver/data/data.mdb"
Fieldname = "[SerialNo]"
strSQL = "SELECT tbldata.* INTO tblNewData FROM tbldata WHERE " &
[Fieldname] & " = '" & [SN2Check] & "' and JobID <> " & [ParentJob] &
";"
Set dbsTrack = OpenDatabase(DataLocation)
'dbsTrack.Execute strSQL
'or
DoCmd.RunSQL strSQL
Exit Function
where
SN2Check is from a Public variable
JobID is a field in the tbldata
ParentJob is from a Public variable (intended to be excluded from
result)
I am trying to create a table in a local mdb from data in a table in
another mdb, without actually linking the two.
Is this possible?
I have tried the code below using the .Execute and the DoCmd.RunSQL
without success.
The error message I get with both these methods is:
..Execute = <3111-Couldn't create;no modify design permission for
table or query 'tblNewData' >
DoCmd.RunSQL = <3078-The Microsoft Jet database engine could not find
the input table or query 'tbldata'. Make sure it exists and that its
name is spelled correctly.>
The table certainly does exist.
Any help gratefully appreciated.
Piri
What I am asking for is all the data in a table called 'tbldata' in an
mdb called data.mdb located in //dataserver/data/ directory where the
Serial Number matches [SN2Check] but excludes the JobID of
[ParentJob], and place that data into (create) table called
[tblNewData ] in the local MDB.
Dim dbsTrack As Database, DataLocation as String
Dim strSQL As String
DataLocation = "//dataserver/data/data.mdb"
Fieldname = "[SerialNo]"
strSQL = "SELECT tbldata.* INTO tblNewData FROM tbldata WHERE " &
[Fieldname] & " = '" & [SN2Check] & "' and JobID <> " & [ParentJob] &
";"
Set dbsTrack = OpenDatabase(DataLocation)
'dbsTrack.Execute strSQL
'or
DoCmd.RunSQL strSQL
Exit Function
where
SN2Check is from a Public variable
JobID is a field in the tbldata
ParentJob is from a Public variable (intended to be excluded from
result)