Dear Community
Sir I have two fields in a table and both of them are of number Data Type (as per ACCESS format). The following is the code Through which I'm trying to enter a calculated data in the Table - Dim Bal_Stock1 As Double
-
Dim STOCK As Integer
-
Dim Issued As Integer
-
Dim Quantity_Stock As Integer
-
Dim Quantity_Issued As Integer
-
Dim Bal_Stock As Integer
-
-
Quantity_Stock = STOCK
-
Quantity_Issued = Issued
-
Bal_Stock = Bal_Stock1
-
-
Bal_Stock1 = stbal(STOCK, Issued)
-
MsgBox (stbal(CDbl(STOCK), CDbl(Issued)))
-
-
sql = "INSERT INTO stock(Item_code,Item_Name,Quantity_Stock,Unit,StockValue,Quantity_issued,unit1,IssuedValue,Bal_Stock,Unit2,StockValue1)VALUES(" & _
-
"' " & txtItem_Code.Text & "',' " & txtItem_Name.Text & " '," & Quantity_Stock & ",' " & txtUnit.Text & "','" & txtStockValue.Text & "'," & Quantity_Issued & ",' " & txtUnit1.Text & "','" & txtIssuedValue.Text & "', " & Bal_Stock & ",'" & txtUnit2.Text & "',' " & txtstockValue1.Text & "') "
Following is the function through which the calculation is done - Function stbal(STOCK As Integer, Issued As Integer) As Double
-
stbal = STOCK - Issued
-
-
End Function
With this above code it is giving
Error "DataType mismatch on criteria expression"
Pls help me
1 1073
Dear Community
...
MsgBox (stbal(CDbl(STOCK), CDbl(Issued)))
...
Function stbal(STOCK As Integer, Issued As Integer) As Double
stbal = STOCK - Issued
End Function
...
Error " DataType mismatch on criteria expression"
Pls help me
CDbl will transform the expression into a Double
stbal use Integers as an input
maybe you should use
stbal(stock, issued)
since they're integers and you dont need to make them doubles for the function to work.
HTH
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Aspersion |
last post by:
I'm building an ASP page that has a lot of text and graphics.
There is a calculation facility on the page. The user enters several
numbers in a form and presses a button to see the calculated...
|
by: anaxamandr |
last post by:
Hi.
I have a long loop in ASP that performs a rather lengthy calculation. I would love for my users to be able to stop that calculation, if they so choose, mid way through the process.
I attempted...
|
by: Del |
last post by:
Thanks in advance for any help.
I have a database that was created in Access 2000. Several users have
been upgraded to Access 2003. Since upgrading to 2003 we have noticed
that some of the...
|
by: cdelaney |
last post by:
I have a form that I created a calculation on using 2003. The
calculation works exactly like I want it to but ONLY on the first and
last record. The calculation does not work/exist on records in...
|
by: gavo |
last post by:
Hi.
using A2K; i have a form containing a continous subform. The question is,
how can i call a calculation for one of the fields in the continous subform
from the main form.
At the moment i...
|
by: Michiel Alsters |
last post by:
Hello everybody,
I hope anybody can help me. I'll try to give a brief overview of my
problem. I have running a program that performs a heavy calculation.
To give the user feedback what the...
|
by: vg-mail |
last post by:
Hello all,
I have identical design for form and report but I am getting
calculation error on form and everything is OK on report. The form and
report are build up on SQL statement. The...
|
by: The alMIGHTY N |
last post by:
Hi all,
Let's say I have a simple math formula:
sum (x * y / 1000) / (sum z / 1000)
I have to do this across 50 items, each with an x, y and z value, when
the page first loads AND when a...
|
by: mattmao |
last post by:
Okay, I was asked by a friend about the result of this limit:
http://bbs.newwise.com/attdata/forumid_14/20070922_fe7f77c81050413a20fbDWYOGm7zeRj3.jpg
Not n->zero but n-> + infinite
I really...
|
by: =?Utf-8?B?amVsbGU3OQ==?= |
last post by:
Hi,
I want to use a difficult Excelsheet as source for my calculation in a
ASP.NET (C#) page. I have 5 input fields on my ASP.NET page and when I press
the submit button I want to put these...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
| |