Who can help with the following Problem?
I have an Access DB, that queries an AS/400 system. My Script looks like this:
Private Sub GetDataFrom As400()
Dim strSQLOld As String
Dim strSQLNew As String
Dim Dbs As DAO.Database
Dim wRSetOpenOld As Boolean
Dim wRSetOpenNew As Boolean
Dim fld As Field
Dim strName As String
Dim rstold As Recordset
Dim rstNew As DAO.Recordset
Dim Dataset As String
Dim Db As Database
Dim X As String
Dim DbName As String
Dim Datum As Integer
Dataset = "myDataset"
DbName = "System Europe"
X = "ODBC;database=" & DbName & ";DSN=" & Dataset & ""
Set Db = OpenDatabase("", False, True, X)
'Datum = 20030717
strSQLOld = "SELECT [LGFIRM], [LGWKNR], [LGTENR], [LGRGDA], FROM LPLI where ((([LGFIRM])='1') AND (([LGWKNR]='000') AND (([LGRGDA]> 20030630))))"
Set rstold = Db.OpenRecordset(strSQLOld)
wRSetOpenOld = True
'Db.Close
..... 'some more sCript follows, but is not important
End Sub
Now, My Question:
If you look at the line: "(([LGRGDA]> 20030630))))" This line queries a specific Date. 30-06-2003
How can I use three comboboxes one for year (eg. 2003) one for the month (eg. 06 one for the day (eg. 30to be used in the SQL statement for the AS/400 Query, so I can replace the 20030630.
Many thanks in advance.
Ramon
I have an Access DB, that queries an AS/400 system. My Script looks like this:
Private Sub GetDataFrom As400()
Dim strSQLOld As String
Dim strSQLNew As String
Dim Dbs As DAO.Database
Dim wRSetOpenOld As Boolean
Dim wRSetOpenNew As Boolean
Dim fld As Field
Dim strName As String
Dim rstold As Recordset
Dim rstNew As DAO.Recordset
Dim Dataset As String
Dim Db As Database
Dim X As String
Dim DbName As String
Dim Datum As Integer
Dataset = "myDataset"
DbName = "System Europe"
X = "ODBC;database=" & DbName & ";DSN=" & Dataset & ""
Set Db = OpenDatabase("", False, True, X)
'Datum = 20030717
strSQLOld = "SELECT [LGFIRM], [LGWKNR], [LGTENR], [LGRGDA], FROM LPLI where ((([LGFIRM])='1') AND (([LGWKNR]='000') AND (([LGRGDA]> 20030630))))"
Set rstold = Db.OpenRecordset(strSQLOld)
wRSetOpenOld = True
'Db.Close
..... 'some more sCript follows, but is not important
End Sub
Now, My Question:
If you look at the line: "(([LGRGDA]> 20030630))))" This line queries a specific Date. 30-06-2003
How can I use three comboboxes one for year (eg. 2003) one for the month (eg. 06 one for the day (eg. 30to be used in the SQL statement for the AS/400 Query, so I can replace the 20030630.
Many thanks in advance.
Ramon