473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

dblong data type mis match in Hide/Unhide columns in Ms Access VBA

1
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
Feb 11 '13 #1
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):
Expand|Select|Wrap|Line Numbers
  1. Function
  2.  Return Type
  3.  Range for expression argument
  4.  
  5. CBool
  6.  Boolean
  7.  Any valid string or numeric expression.
  8.  
  9. CByte
  10.  Byte
  11.  0 to 255.
  12.  
  13. CCur
  14.  Currency
  15.  -922,337,203,685,477.5808 to 922,337,203,685,477.5807.
  16.  
  17. CDate
  18.  Date
  19.  Any valid date expression.
  20.  
  21. CDbl
  22.  Double
  23.  -1.79769313486231E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values.
  24.  
  25. CDec
  26.  Decimal
  27.  +/-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.
  28.  
  29. CInt
  30.  Integer
  31.  -32,768 to 32,767; fractions are rounded.
  32.  
  33. CLng
  34.  Long
  35.  -2,147,483,648 to 2,147,483,647; fractions are rounded.
  36.  
  37. CLngLng
  38.  LongLong
  39.  -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807; fractions are rounded. (Valid on 64-bit platforms only.)
  40.  
  41. CLngPtr
  42.  LongPtr
  43.  -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. 
  44.  
  45. CSng
  46.  Single
  47.  -3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values.
  48.  
  49. CStr
  50.  String
  51.  Returns for CStr depend on the expression argument.
  52.  
  53. CVar
  54.  Variant
  55.  Same range as Double for numerics. Same range as String for non-numerics.
Feb 11 '13 #2
NeoPa
32,556 Expert Mod 16PB
The VBA equivalent of Double is dbDouble. Replacing dbLong with number could never work, obviously.
Feb 11 '13 #3
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.
Feb 11 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Peter K | last post by:
How do I Hide/Unhide the Main Database Window in VB?
1
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. ...
8
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...
3
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...
1
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...
1
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.
2
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...
2
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...
11
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
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...
0
agi2029
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.