Hey everyone,
So I was working on a project and I have two queries, but I only want one or the other to run based on a dlookup with another table.
So my codes does three IF statements in the beginning. It checks to see if the data has already been inputted. Then it will transfer an excel spreadsheet into a temp table. Once that is complete I have 7 queries that will run in the background on the temp table to format it and move stuff around. So what I want is the third query down either needs to put data in three columns or if information is already in those three columns then put it in another three columns. So I was thinking of something like this for the code:
<code>
If IsNull(DLookup("[createdtime]", _
"table1", _
"[createdtime]=" ")) Then
DoCmd.OpenQuery "qry1"
Else
If IsNull(DLookup("[createdtime]", _
"table1"
"[createdtime]=" ")) = False Then
DoCmd.OpenQuery "qry2"
End If
End If
A is this the correct way or am I missing something? Thanks
So I was working on a project and I have two queries, but I only want one or the other to run based on a dlookup with another table.
So my codes does three IF statements in the beginning. It checks to see if the data has already been inputted. Then it will transfer an excel spreadsheet into a temp table. Once that is complete I have 7 queries that will run in the background on the temp table to format it and move stuff around. So what I want is the third query down either needs to put data in three columns or if information is already in those three columns then put it in another three columns. So I was thinking of something like this for the code:
<code>
If IsNull(DLookup("[createdtime]", _
"table1", _
"[createdtime]=" ")) Then
DoCmd.OpenQuery "qry1"
Else
If IsNull(DLookup("[createdtime]", _
"table1"
"[createdtime]=" ")) = False Then
DoCmd.OpenQuery "qry2"
End If
End If
A is this the correct way or am I missing something? Thanks