Re: Problems with SQL coding on VB command button
- From: "Svetlana" <AccessMindMe@xxxxxxxxx>
- Date: 20 Jun 2006 03:26:10 -0700
Hi dakoris73, you could use Nz() function to handle your null values if
any.
Also i see that there are sql clauses that are not written right
Examble:
strTxtAgtID = "SELECT AgentID, Date, Software, ProbDesc, LineGroup FROM
EOSMain WHERE EOSMain.[AgentID] = 'strAgtID';"
you must change it to
strTxtAgtID = "SELECT AgentID, Date, Software, ProbDesc, LineGroup FROM
EOSMain WHERE EOSMain.[AgentID] =" & CLng(strAgtID) & ";"
if your AgentID is a long Data type
or
strTxtAgtID = "SELECT AgentID, Date, Software, ProbDesc, LineGroup FROM
EOSMain WHERE EOSMain.[AgentID] =""" & strAgtID & """;"
if your AgentID is string data type - I hope not :)
Additional for dates before passing them into your sql clauses try to
validate them as dates with the function CDate().
Make these changes and see how it works.
.
- References:
- Problems with SQL coding on VB command button
- From: dakoris73
- Problems with SQL coding on VB command button
- Prev by Date: How do I run this code?
- Next by Date: Re: Next Record from subform
- Previous by thread: Problems with SQL coding on VB command button
- Index(es):