Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / July 2006

Tip: Looking for answers? Try searching our database.

button action

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
geebee - 28 Jun 2006 22:50 GMT
hi,

I have the following behind a label's OnClick event:

MsgBox "test"
Dim sSQL As String
sSQL = "INSERT INTO tbl_test (asofdate, Nr7, nr7_verify, nr7_passed?, Amt7,
amt7_verify, amt7_passed?, " _
& "nr31, nr31_verify, nr_31_passed?, amt31, amt31_verify, amt_31_passed?,
nr61, nr61_verify, nr61_passed?, " _
& "amt61, amt61_verify, amt61_passed?, nr91, nr61_verify, nr61_passed?,
amt61, amt61_verify, amt61_passed?, " _
& "nr91, nr91_verify, nr91_passed?, amt91, amt91_verify, amt91_passed?) " _
& "VALUES ( '" & Me.AsOfDate1 & "', " & Me.SumOfNr7 & ", " &
Me.SumOfNr7_verify & ", " & Me.nr7_passed & ", " & Me.SumOfAmt7 & ", " &
Me.SumOfAmt7_verify & ", " & Me.amt7_passed & ", " & Me.SumOfNr31 & ", " &
Me.SumOfNr31_verify & ", " & Me.nr31_passed & ", " & Me.SumOfAmt31 & ", " &
Me.SumOfAmt31_verify & ", " & Me.amt31_passed & ", " & Me.SumOfNr61 & ", " &
Me.SumOfNr61_verify & ", " & Me.nr61_passed & ", " & Me.SumOfAmt61 & ", " &
Me.SumOfAmt61_verify & ", " & Me.amt61_passed & ", " & Me.SumOfNr91 & ", " &
Me.SumOfNr91_verify & ", " & Me.nr91_passed & ", " & Me.SumOfAmt91 & ", " &
Me.SumOfAmt91_verify & ", " & Me.amt91_passed & " );"
DoCmd.RunSQL sSQL

The msgbox appears, but then nothing else happens.  so the append does not
happen.  it might be helpful to know that the [...passed] and the [...verify]
fields are all calculated fields.  the rest actually come from values stored
in a linked table (linked to an excel spreadsheet).  Can anyone explain what
is going wrong, and how I can fix this?

Thanks in advance,
geebee
Michel Walsh - 01 Jul 2006 13:06 GMT
Hi,

What is the kind of error handling you have (On Error Resume Next ? )

Before the DoCmd.RunSQL,  add

   Debug.Print sSql

and after the DoCmd.RunSQL, add

   Debug.Assert Error.Number = 0

Then, if the assertion is wrong, the program will stop in debug mode, and
examine the string in the immediate debug window. Cut and paste it in the
SQL view of a new query to help see what is wrong with it.

Hoping it may help,
Vanderghast, Access MVP

> hi,
>
[quoted text clipped - 38 lines]
> Thanks in advance,
> geebee
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.