B
Beginner
Hi!
I would like to use the DMin function to get one piece of information from
an external database. I need to find the smallest date from a table in the
database so that I can do my own queries based on that date.
My problem is that I have no idea how to do this. I am thinking that I
should open the database using OpenDatabase-method, but after this I don't
know what to do. I tried to open the table into a recordset, but it failed.
My code so far:
Dim rs1 As ADODB.Recordset
Dim db As Database
Dim d As String
Set db = OpenDatabase("TheDatabase")
Set rs1 = db.OpenRecordset("TheTable") //this doesn't work
'and then I would do like
d = DMin("[TheField]", rs1)
Help is appreciated
-Beginner-
I would like to use the DMin function to get one piece of information from
an external database. I need to find the smallest date from a table in the
database so that I can do my own queries based on that date.
My problem is that I have no idea how to do this. I am thinking that I
should open the database using OpenDatabase-method, but after this I don't
know what to do. I tried to open the table into a recordset, but it failed.
My code so far:
Dim rs1 As ADODB.Recordset
Dim db As Database
Dim d As String
Set db = OpenDatabase("TheDatabase")
Set rs1 = db.OpenRecordset("TheTable") //this doesn't work
'and then I would do like
d = DMin("[TheField]", rs1)
Help is appreciated
-Beginner-