on sale report I want to make a check if customer doesnot pay full
amount then his dues go in to his account recieveable table. I am
trying this in vba and when I complie it on RunSQL it gives me error
"wrong number of argments", Can any one help plzzz
If Val(Me.Due) > 0 Then
DoCmd.RunSQL "Insert into [tblAccountRCA]
(customerID,reciept#,amountDue) values(" & _
[Customer], [SaleID], [Due] & ")" 9 3326
On 27 May 2005 05:47:40 -0700, "khan" <ah******@gmail.com> wrote:
Funny characters like # can trip you up. Rather use a field name like
"ReceiptNo".
The best way to debug this is to set a breakpoint on this line,
collect the SQL statement in the debug window, and paste it into a new
query. When you try to run it there, Access will point out the errors
of your ways.
-Tom. on sale report I want to make a check if customer doesnot pay full amount then his dues go in to his account recieveable table. I am trying this in vba and when I complie it on RunSQL it gives me error "wrong number of argments", Can any one help plzzz
If Val(Me.Due) > 0 Then DoCmd.RunSQL "Insert into [tblAccountRCA] (customerID,reciept#,amountDue) values(" & _ [Customer], [SaleID], [Due] & ")"
With the non alpha numeric character in Reciept#, you may need brackets
([Receipt#]). Also, Receipt is misspelled, if that is causing you a problem.
However, the "wrong number of arguments" is coming from the Values
statement.
If Val(Me.Due) > 0 Then
DoCmd.RunSQL "Insert into [tblAccountRCA]
(customerID,reciept#,amountDue) values (" & _
[Customer] & ", " & [SaleID] & ", " & [Due] & ")"
--
Wayne Morgan
MS Access MVP
"khan" <ah******@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com... on sale report I want to make a check if customer doesnot pay full amount then his dues go in to his account recieveable table. I am trying this in vba and when I complie it on RunSQL it gives me error "wrong number of argments", Can any one help plzzz
If Val(Me.Due) > 0 Then DoCmd.RunSQL "Insert into [tblAccountRCA] (customerID,reciept#,amountDue) values(" & _ [Customer], [SaleID], [Due] & ")"
I haven't tested it, but suspect it may be as simple as bad syntax. Try:
If Val(Me!Due) > 0 Then
DoCmd.RunSQL "Insert into [tblAccountRCA]
(customerID,[reciept#],amountDue) values(" & _
[Customer], [SaleID], [Due] & ")"
-Ed
"khan" <ah******@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com... on sale report I want to make a check if customer doesnot pay full amount then his dues go in to his account recieveable table. I am trying this in vba and when I complie it on RunSQL it gives me error "wrong number of argments", Can any one help plzzz
If Val(Me.Due) > 0 Then DoCmd.RunSQL "Insert into [tblAccountRCA] (customerID,reciept#,amountDue) values(" & _ [Customer], [SaleID], [Due] & ")"
If Val(Me.Due) > 0 Then
DoCmd.RunSQL "Insert into [tblAccountRCA]
(customerID,reciept#,amountDue*) values(" & _
[Customer], [SaleID], [Due] & ")"
my table has ACRID , customerID,reciept# and amountdue
ACRID is an autonumber. can you help
hey guys, my table has 4 fields.
ARCID(autonumber), customerID, reciept#,amountdue.
Dont you think it could be bcz of missing ARCID.
If Val(Me.Due) > 0 Then
DoCmd.RunSQL "Insert into [tblAccountRCA]
(customerID,reciept#,amountDue*) values (" & _
[Customer] & ", " & [SaleID] & ", " & [Due] & ")"
what do I do about autonumber ARCID.
The Autonumber field isn't a problem, the table will automatically generate
a number for this field as you add each record. The problem is that you need
to pass 3 parameters separated by commas. The way you have your quotation
marks, the commas aren't being passed as part of the SQL string. See my
previous message to fix this.
--
Wayne Morgan
MS Access MVP
"khan" <ah******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
If Val(Me.Due) > 0 Then
DoCmd.RunSQL "Insert into [tblAccountRCA]
(customerID,reciept#,amountDue*) values(" & _
[Customer], [SaleID], [Due] & ")"
my table has ACRID , customerID,reciept# and amountdue
ACRID is an autonumber. can you help
Hey Wayne
Yes you were right but now I am getting another problem here. When i
click button to open my receipt or invoice then it says"You entered an
expression which has no value"
here is all my code
Private Sub Report_Open(Cancel As Integer)
On Error GoTo Err_Report_Open
DoCmd.SetWarnings False
If ([Reports]![reciept]![Due]) > 0 Then
DoCmd.RunSQL "Insert into
[tblAccountRCA](customerID,reciept#,amountDue) values (" & _
[Customer] & ", " & [SaleID] & ", " & [Due] & ")"
End If
Exit_Report_Open:
Exit Sub
Err_Report_Open:
MsgBox Err.Description
Resume Exit_Report_Open
End Sub
Can you help please
You probably can't get an accurate value for Due in the report's Open event.
I'm assuming this open event is for the Receipt report. Instead, you
probably need to check for this in the Format event of the report section
that uses the Due value. Also, if the report is Receipt, then you don't need
to say Reports!Receipt!Due, you could just shorten that to Me!Due.
--
Wayne Morgan
MS Access MVP
"khan" <ah******@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com... Hey Wayne
Yes you were right but now I am getting another problem here. When i click button to open my receipt or invoice then it says"You entered an expression which has no value" here is all my code
Private Sub Report_Open(Cancel As Integer) On Error GoTo Err_Report_Open DoCmd.SetWarnings False
If ([Reports]![reciept]![Due]) > 0 Then DoCmd.RunSQL "Insert into [tblAccountRCA](customerID,reciept#,amountDue) values (" & _ [Customer] & ", " & [SaleID] & ", " & [Due] & ")"
End If
Exit_Report_Open: Exit Sub
Err_Report_Open: MsgBox Err.Description Resume Exit_Report_Open
End Sub
Can you help please
Autonumber fields are just like the name says, each new record will generate
a unique value in the autonumber field.
No user action required.
-Ed
"khan" <ah******@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
hey guys, my table has 4 fields.
ARCID(autonumber), customerID, reciept#,amountdue.
Dont you think it could be bcz of missing ARCID.
If Val(Me.Due) > 0 Then
DoCmd.RunSQL "Insert into [tblAccountRCA]
(customerID,reciept#,amountDue*) values (" & _
[Customer] & ", " & [SaleID] & ", " & [Due] & ")"
what do I do about autonumber ARCID. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Sans Spam |
last post by:
Greetings! I have a table that contains all of the function
permissions within a given application. These functions are different
sections of a site and each has its own permissions (READ, WRITE,...
|
by: shottarum |
last post by:
I currently have 2 tables as follows:
CREATE TABLE .
(
mhan8 int,
mhac02 varchar(5),
mhmot varchar(5),
mhupmj int
)
|
by: serge |
last post by:
I have a scenario where two tables are in a One-to-Many relationship
and I need to move the data from the Many table to the One table so
that it becomes a One-to-One relationship.
I need to...
|
by: robert |
last post by:
been ruminating on the question (mostly in a 390/v7 context) of
whether, and if so when, a row update becomes an insert/delete.
i assume that there is a threshold on the number of columns of
the...
|
by: kosta |
last post by:
hello! one of my forms communicates with a database, and is
supposed to add a row to a table using an Insert
statement... however, I get a 'oledb - syntax error'
exception... I have double...
|
by: Chris Ochs |
last post by:
The documentation doesn't have any examples of using an sql language
function to do an insert, andI am at loss as to I am doing wrong here.
The error I get trying to create the function is: ERROR:...
|
by: Geoffrey KRETZ |
last post by:
Hello,
I'm wondering if the following behaviour is the correct one for
PostGreSQL (7.4 on UNIX).
I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching
the following request :...
|
by: rn5a |
last post by:
During registration, users are supposed to enter the following
details: First Name, Last Name, EMail, UserName, Password, Confirm
Password, Address, City, State, Country, Zip & Phone Number. I am...
|
by: Red |
last post by:
If auto-format is turned off in VS2008, there is apparently no way to
indent a line. Under Tools->Options->Text Editor->C#->Formatting,
there are three checkboxes. Unchecking those seems to cause...
|
by: Maklar60 |
last post by:
I am attempting to execute an INSERT statement on my page but continually get the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
Incorrect syntax near '<'.
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |