Taff
Registered User.
- Local time
- Today, 08:04
- Joined
- Feb 3, 2004
- Messages
- 158
Hi all,
Have tried searching the forums but to no avail.
I have a table the records imports to the database. It records the Name, Time Created, Date Created, Time Imported and Date Imported.
When I import the a file to the database the Name, Time Created and Date Created are stored in unbound text boxes on my forms.
What I am trying to do is check if the file I am trying to Import has already been imported.
The table which I record the Import details to is called tblImportDetails and the fields are as follows:-
DatasetName - Text
CreationDate - Short Date
CreationTime - Long Time
DateImported - Short Date
TimeImported - Long Time
My unbound fields on my forms are called txtCreationDate and txtCreationTime these are also in the format of Short Date and Long Time.
I have the following Code behind a command button:-
However when I Click the command button nothing happens and I know the values do exist and are the same.
Am not sure if I am on the right track so any help is greatly appreciated.
Anthony.
Have tried searching the forums but to no avail.
I have a table the records imports to the database. It records the Name, Time Created, Date Created, Time Imported and Date Imported.
When I import the a file to the database the Name, Time Created and Date Created are stored in unbound text boxes on my forms.
What I am trying to do is check if the file I am trying to Import has already been imported.
The table which I record the Import details to is called tblImportDetails and the fields are as follows:-
DatasetName - Text
CreationDate - Short Date
CreationTime - Long Time
DateImported - Short Date
TimeImported - Long Time
My unbound fields on my forms are called txtCreationDate and txtCreationTime these are also in the format of Short Date and Long Time.
I have the following Code behind a command button:-
Code:
Dim VarCheckDate As Variant, VarCheckTime As Variant, VarDataset As Variant
VarCheckDate = DLookup("[CreationDate]", "ImportDetails", "[CreationDate] = " & Me!txtCreationDate & "")
VarDataset = DLookup("[Datasetname]", "tblImportDetails", "[Datasetname] = '" & Me!txtDatasetName & "'")
VarCheckTime = DLookup("[CreationTime]", "ImportDetails", "[CreationTime] = #" & Me.txtCreationTime & "#")
If VarCheckDate = Me.txtCreationDate And VarCheckTime = Me.txtCreationTime And VarDataset = Me.txtDatasetName Then
MsgBox "Already Imported"
End if
However when I Click the command button nothing happens and I know the values do exist and are the same.
Am not sure if I am on the right track so any help is greatly appreciated.
Anthony.