I'm sorry. I was just trying to only put the relevant code. I thought the obvious things would be assumed like dim'ing and setting the variable strSQL. Option Explicit. My apologies. I thought that was enough to see the issue.
I opened the recordset. I grabbed a field value from the first...
The recordset was successfully opened. I retrieved the value of a field from the first record (for group break purposes later). Only when it hits the "Do Until rs.eof" does it fail. If you look at my original post, you see where I noted success and where I noted failure.
I already said it's working. The easy variables are assumed. Dim strSQL, ok there ya go.
It opens the recordset, gets the value of the first record's data (one field), then tries to loop. Only after the field value is retrieved does it fail, at the start of the loop. The recordset had EOF =...
Yes it passes that line and the value is assigned.
EOF is false before that value is accessed and assigned to the variable.
After the value is assigned, the variable has the correct value "BS".
Only after it assigns this value do I get the error at "Do Until rs.eof".
I get a record count from...
This is such a simple basic thing I've done for decades yet now a problem? I'm sure it's something silly I'm missing. A search provides no answer for my situation.
Library reference is to Microsoft Office 16.0 Access database engine object library. I removed that and changed it to DAO 3.6...
I just wrote this to get a formated version of the field value for use in the Where clause:
Public Function GetFormFieldValue() As String
GetFormFieldValue = Format([Forms]![frmMainMenu]![StartDate], "mmm") & "-" & Format([Forms]![frmMainMenu]![StartDate], "yyyy")
End Function
=DLookup("[temptablekitmove]", "[Parthistory]", "[Serial Number] = '" & me.[part1c] & "'") if a string value.
=DLookup("[temptablekitmove]", "[Parthistory]", "[Serial Number] = " & me.[part1c]) if numeric
Sent from my SM-N910V using Tapatalk
Private Declare PtrSafe Function GetUserName Lib "advapi32.dll" Alias
"GetUserNameA" (ByVal lpBuffer As String, nSize As LongPtr) As Long
Try this
Sent from my SM-N910V using Tapatalk