FacilitiesCAD
Technical User
First Thank you everyone for the great posts here. I have learned alot about access from here. You have saved me unmeasurable time in organizing data.
I am trying to maintain a database of all the autocad drawings on a specific public drive.
The code bellow allows me to add a new record if it isn't found in the database. This is a great step forward for me. I am now tring to close up some loose ends.
I would like a way set a variable "status1" to "lost" for every record in a table called "table_files1". By marking everything "lost" I would like to then mark them "Found" if it shows up as part of my test for duplicates. I would mark new records as "New" as seen in the line !Status1 = "New" bellow.
This will then seperate my data into 3 catagories.
"Lost" where the file has been moved or deleted since I last updated the database and I will need to investigate further.
"New" where its a new entry to the database that needs more information added to it.
or "Found" where the data was already there and needs no more editing.
I don't know how to set a variable for every record to the same value. I expect it is some kind of loop just not sure of the syntax.
Once I use the Dcount test to find a duplicate and stop re-entry of data how do I change the records original variable to a new value. I expect it is something like dlookup but I'm just not sure.
Any solutions or hints are aprecialted.
Tim
Code follows bellow:
Xi = DCount("Saved_Date1", "Table_files1", "Path1 = '" & Path2 & "' and File1 = '" & File2 & "'")
If Xi > 0 Then
' insert here way to show "found" records
Else
With rstDWG
.AddNew
!Path1 = Path2
!Saved_Date1 = Saved_Date2
!Saved_Time1 = Saved_Time2
!File_Size1 = File_Size2
!File1 = File2
'insert here way to show "new" records
!Status1 = "New"
.Update
.Bookmark = .LastModified
End With
End If 'Xi if
I am trying to maintain a database of all the autocad drawings on a specific public drive.
The code bellow allows me to add a new record if it isn't found in the database. This is a great step forward for me. I am now tring to close up some loose ends.
I would like a way set a variable "status1" to "lost" for every record in a table called "table_files1". By marking everything "lost" I would like to then mark them "Found" if it shows up as part of my test for duplicates. I would mark new records as "New" as seen in the line !Status1 = "New" bellow.
This will then seperate my data into 3 catagories.
"Lost" where the file has been moved or deleted since I last updated the database and I will need to investigate further.
"New" where its a new entry to the database that needs more information added to it.
or "Found" where the data was already there and needs no more editing.
I don't know how to set a variable for every record to the same value. I expect it is some kind of loop just not sure of the syntax.
Once I use the Dcount test to find a duplicate and stop re-entry of data how do I change the records original variable to a new value. I expect it is something like dlookup but I'm just not sure.
Any solutions or hints are aprecialted.
Tim
Code follows bellow:
Xi = DCount("Saved_Date1", "Table_files1", "Path1 = '" & Path2 & "' and File1 = '" & File2 & "'")
If Xi > 0 Then
' insert here way to show "found" records
Else
With rstDWG
.AddNew
!Path1 = Path2
!Saved_Date1 = Saved_Date2
!Saved_Time1 = Saved_Time2
!File_Size1 = File_Size2
!File1 = File2
'insert here way to show "new" records
!Status1 = "New"
.Update
.Bookmark = .LastModified
End With
End If 'Xi if