Open recordset

  • Thread starter Thread starter cindy.kester
  • Start date Start date
C

cindy.kester

I import an Excel workbook into Access on a monthly basis
and store a "date" field as '200408' for the month
imported. I now need to write code to check the table to
see if the month was imported so it doesn't get imported
again. I typically import the data for the prior month,
but that's not always the case. My thought was to have a
form with a combo box listing the month values as 200408,
200409, etc. and then open the table to check for that
value. Good thought but I don't know exactly how to do
that. I tried numerous attempts with openrecordset and
then find but to no avail.

Please assist. Thank you.

Cindy
 
if you're planning to select a value from the combo box list, then check to
see if that value is in the data table, suggest you use a DLookup()
function, something like

If Not IsNull(DLookup("DateValueField", "DataTableName", "DateValueField
= '" & Me!ComboboxName & "'")) Then
'take some action
End If

the above assumes that the date value field is actually a text data type,
not date/time.

hth
 
Tina,

Thanks for your help. It works.
-----Original Message-----
if you're planning to select a value from the combo box list, then check to
see if that value is in the data table, suggest you use a DLookup()
function, something like

If Not IsNull(DLookup
("DateValueField", "DataTableName", "DateValueField
 
Back
Top