crossy5575
Registered User.
- Local time
- Today, 20:03
- Joined
- Apr 21, 2015
- Messages
- 46
Hi there,
I have created a query in VBA to find a max id number from which i can then do 'things'
I am getting a runtime error stating the field is too small to accept the amount of data
I have removed the set db lines etc as they have no effect, in fact they make things worse with more issues!
how do i get the dmax to work?
thanks
Simon
I have created a query in VBA to find a max id number from which i can then do 'things'
I am getting a runtime error stating the field is too small to accept the amount of data
PHP:
Public Function holquery(findx As Integer)
Dim strSQL As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
strSQL = "SELECT [12b Holsub].[staff no], [12c holdetail].hcID, [12c holdetail].dayscf " & _
"FROM ([01 Name] INNER JOIN [12b Holsub] ON [01 Name].ID = [12b Holsub].[staff no]) INNER JOIN ([12 Holiday] INNER JOIN [12c holdetail] ON [12 Holiday].ID = [12c holdetail].hcID) ON [12b Holsub].ID = [12 Holiday].holidayno " & _
"WHERE ((([12b Holsub].[staff no])=" & findx & "));"
'Set db = CurrentDb
'Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
'rs.MoveLast
'rs.MoveFirst
holquery = DMax("hcID", strSQL)
holquery2 = DLookup("dayscf", "12c holdetail", "hcID =" & holquery)
'Set db = Nothing
'Set rs = Nothing
End Function
I have removed the set db lines etc as they have no effect, in fact they make things worse with more issues!
how do i get the dmax to work?
thanks
Simon