Variant Not Getting The Value

Jun 14, 2005

Hi guys, this worked under access 2000, but not anymore under 2003
"strtrans" is not getting the value.
I can't find what's wrong, tried string, defininf them in a module. Nothing.
Anybody any idea why that is?
Here's the code:

Dim strTable As Variant
Dim strField As Variant
Dim strtrans As Variant
Dim stDocName1 As Variant
Dim stDocName As Variant
stDocName1 = "qerDelActieTabel"
stDocName = "qerUpdateActietabel"
On Error GoTo Err_Knop20_Click
Me.Probleem.SetFocus
If Me.Probleem.Text = "" Then
DoCmd.Close
Else
Me.Appcode.SetFocus
If Me.Appcode.Text = "" Then
strTable = "tblActie"
strField = "Probleem"
strtrans = Me.Ingavedatum.Value
strtrans = strtrans & "ac" & DCount(strField, strTable)
Me.Appcode.Text = strtrans
MsgBox sttrans & strField & strTable & stDocName & stDocName1
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.Close
Else
MsgBox sttrans & strField & strTable & stDocName & stDocName1
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenQuery stDocName1, acNormal, acEdit
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.Close
End If
End If
Exit_Knop20_Click:
Exit Sub

Err_Knop20_Click:
MsgBox Err.Description
Resume Exit_Knop20_Click

(eddited for clarity)

View Replies


ADVERTISEMENT

Variant Data Type Acc97 And 2000

Feb 6, 2006

This is a follow up to a problem I had with a Subreport which I have now solved but would like additional information on the differences between 97 and 2000.

basically I ghad a subreport that worked in97 but gave Invalid Argument in 2000.

It appears that the linking field was too long and this caused the Invalid Argument.

The fileds were a concatonation of two fields. One Number and One Text Field. Yes they were a bit long in certain circumstances but for fairly good reasons. I believe these would be generated as Type Variant.

Does anybody know the differences in teh Variant Type between 97 and 2000. I have tried searching teh Help in 2000 but unable to find any info or indeed the correct phrase to search on.

len

View 3 Replies View Related

Modules & VBA :: Convert Variant To Access Table?

Aug 20, 2013

Creating a recordset from an Access table

Copy that recordset into a Variant variable, similar to a matrix

Run a Heuristic Algorithm on the matrix to populate values

Delete * from the orginal Access table

Input new data into the Original Access table by looping through matrix with an INSERT INTO statement.

This method works but I do not like the loop in step 5 as I am calling an INSERT INTO statement 800+ times and can be slow. Any way to view the variant as a whole and not have to loop through the entire matrix. Maybe possibly converting the variant to an Access tabledef.

View 2 Replies View Related

You Tried To Assign The Null Value To A Variable That Is Not A Variant Data Type. (Er

Jul 1, 2007

Hi,

I am getting this error 'You tried to assign the Null value to a variable that is not a Variant data type. (Error 3162)' I know why I am getting the error, I found out that Form and Subform should be implemented only with one-to-many relationships where the Subform is the many end. However, I have the opposite of that for a reason.

Is this bad practice? Is there anyway around it or to fix the error please?

Any help will be very much appreciated,
B

View 14 Replies View Related

Storing Integers Between 0 And About 808 Quadrillion -- Strings, Decimal, Or Variant?

Feb 25, 2008

I need to be able to precisely handle nonnegative integers (in the math sense of integer, not the VBA sense, of course) between the values of 0 and 808,035,046,350,570,000. (Don't ask.)

I'm wondering whether I should be handling these numbers in a string and do everything manually, or whether the datatype Decimal or Variant will work for me.

I read that Decimal handles +-79,228,162,514,264,337,593,543,950,335 with no decimal point, or +-7.9228162514264337593543950335 with 28 places to the right of the decimal.

I absolutely cannot have the "rounding type errors" and "oddities" that you get by storing integer values in doubles, for example, due to imprecission.

Seeing that Decimal seems to work in a decimal point manner worries me, that perhaps I shouldn't be using it for this scenario. However, it's range seems so much larger than what I need, I'm wondering if I would "get away" with it.

If needing no imprecission to creep in means that I have to use Strings and implement my own String math library, that's the route I would have to go.

Question 1 - If I need the numbers to be exact (again, nonnegative integers, no decimal points), do I need to use a String, or should I use a Decimal or Variant type?

Question 2 - What is the difference between Double and Variant, for the purposes of storing numeric values? I read that Doubles are 8 bytes, and Variants are 16 bytes, however the Variant description is "Any numeric value up to the range of Double", which confuses me since it's double the size.

View 5 Replies View Related

Forms :: Allowing Empty String In A Textbox - Variant Data Type

Jan 19, 2014

I have an Access 2010 database where we have a SQL Linked Table with a column that is nVARCHAR(20) Not Null data type. We have created a form for data entry. Currently when the user tries to erase a value or choose not to define a value we get the following error.

"You tried to assign the Null value to a variable that is not a Variant data type."

This field should accept a blank value "" as the user may not want to set the value. We do not have control over the DB schema, so how can I work around this issue in access?

View 4 Replies View Related

Modules & VBA :: Return Rows In Query From Variant Array Return From UDF

Sep 16, 2014

I have a simple UDF that takes a string and returns a variant, which is an array of strings Example Input "Brick Wall" Return value would be a variant array with first element "Brick" and and second element "Wall" Now I have a table with a field of strings, and I want to make a query that returns all the results from the function, one per line.

So if my input table looks like this

[strField]
"kick the ball"
"return the pass"

my query result should looks like this

[Orig] [new]
"kick the ball" "kick"
"kick the ball" "the"
"kick the ball" "ball"
"return the pass" "return"
"return the pass" "the"
"return the pass" "pass"

Last time I had to do something like this I used VBA exclusively, with ADO objects, but I thought a query based solution would be easier.

With my current data the largest return array size my function returns is 27 elements but I wouldn't want to rely on that number being fixed.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved