Hi
I have column with Number as data type. I want to hide this column using VBA coding.But in VBA coding we pass dblong as data type,so it is showing type mis matche. If i use number in place of dblong it showing error as conversion fail. Pls help
3 1990 zmbd 5,501
Expert Mod 4TB
You really have provided very little information.
Go back to your table.
Open in design mode.
Select the field in question.
In the field definition, you indicate that it is "Number" however, you fail to mention what type class that numeric field is, look down at the bottom of the UI. There will be a grid. In that grid you will have a tab named "General" and under that a row with title of "Field Size." I'd bet it is set to "Long Integer" change that to "Double."
If you have to have the result as an integer, then you will need to change the typecast in your VBA by using CLng
As a reference
VBA Conversion Functions (taken from the help file and other reference sources): - Function
-
Return Type
-
Range for expression argument
-
-
CBool
-
Boolean
-
Any valid string or numeric expression.
-
-
CByte
-
Byte
-
0 to 255.
-
-
CCur
-
Currency
-
-922,337,203,685,477.5808 to 922,337,203,685,477.5807.
-
-
CDate
-
Date
-
Any valid date expression.
-
-
CDbl
-
Double
-
-1.79769313486231E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values.
-
-
CDec
-
Decimal
-
+/-79,228,162,514,264,337,593,543,950,335 for zero-scaled numbers, that is, numbers with no decimal places. For numbers with 28 decimal places, the range is +/-7.9228162514264337593543950335. The smallest possible non-zero number is 0.0000000000000000000000000001.
-
-
CInt
-
Integer
-
-32,768 to 32,767; fractions are rounded.
-
-
CLng
-
Long
-
-2,147,483,648 to 2,147,483,647; fractions are rounded.
-
-
CLngLng
-
LongLong
-
-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807; fractions are rounded. (Valid on 64-bit platforms only.)
-
-
CLngPtr
-
LongPtr
-
-2,147,483,648 to 2,147,483,647 on 32-bit systems, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 on 64-bit systems; fractions are rounded for 32-bit and 64-bit systems.
-
-
CSng
-
Single
-
-3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values.
-
-
CStr
-
String
-
Returns for CStr depend on the expression argument.
-
-
CVar
-
Variant
-
Same range as Double for numerics. Same range as String for non-numerics.
NeoPa 32,556
Expert Mod 16PB
The VBA equivalent of Double is dbDouble. Replacing dbLong with number could never work, obviously.
zmbd 5,501
Expert Mod 4TB
Actually,
Re-reading OP
We startout with, "how to hide a coulmn?"
and end up with, "how to solve a type cast mismatch"
I really should have just closed the thread and asked OP to try and re-word the question.
Which is what I'll do after lunch if a clarification isn't posted by then by OP.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Peter K |
last post by:
How do I Hide/Unhide the Main Database Window in VB?
|
by: glenn |
last post by:
Hi folks,
I am doing an UPDATE to a table that has a field for a DATE data type. I am
using MS Access.
The UPDATE works fine but when I try to place the DATE field in the mix it
blows up.
...
|
by: mjoytan |
last post by:
In my real estate access database, I'm trying to create a report that will give me all the properties that are due for a lease renewal this year.
I've been able to use datediff to tell me how...
|
by: toodi4 |
last post by:
I'm using a javascript that hides and unhides text based on a button
click. It works great across static fields on a form. The problem I
have is that I'm trying to hide and unhide various fields...
|
by: rharding |
last post by:
I have a SQL database which contains a table (TblA) with a field (Fld1) defined as "bigint". When the SQL table is linked to Access the design view of the linked table shows this field as a data type...
|
by: Simon |
last post by:
Dear reader,
In a datasheet form you have the possibility to hide or unhide columns.
But in case the datasheet form is a sub-form this functionality is not
longer available.
|
by: nduerr |
last post by:
I have a table with pdf files stored in an attachment data type field
in a 2007 Access File. I would like to run a query that would select
a group out of this table (easy part) then send the pdf...
|
by: tmoon3 |
last post by:
Hello,
This must be a simple mistake, but for some reason I cannot seem to get around it.
I am simply trying to create a report of all employees that have a date filled in in a training column...
|
by: Etienne1 |
last post by:
Hello,
I have a report with a subreport that has a subreport that as a subreport and so on. I have so far 6 levels and each of them is linked to his parent. What I'm trying to do is when a new...
|
by: atencorps |
last post by:
Hello
I have the following code but need some help on it. The idea of the code is the main sections ie Service Management are viewable when the page is loaded and by clicking on the main...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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: 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:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |