Changing fieldsize in code 
Author Message
 Changing fieldsize in code

I have found a partial solution on Microsofts site -
Q128016 where you build a function
(AlterFieldType "PROD1", "UnitsInStock", "LONG")
that does the steps that Alex describes, however If I put
it in code tied to an event, I get Expected varaible or
procedure, and if it put it directly into the Event
parameters, I get a 'cannot find the macro....'

Is there anyway to stick this somewhere so I can clean up
a daily import table?



Tue, 03 May 2005 01:30:35 GMT  
 Changing fieldsize in code
I would call the function from code, rather than binding it an event on a
form. Altering data types/tables are best handled this way. FWIW... You
could even call it from VBA from thte event, you shouldn't put it directly
in the Event's signature in the Properties window.

 -- Dev


Quote:

> I have found a partial solution on Microsofts site -
> Q128016 where you build a function
> (AlterFieldType "PROD1", "UnitsInStock", "LONG")
> that does the steps that Alex describes, however If I put
> it in code tied to an event, I get Expected varaible or
> procedure, and if it put it directly into the Event
> parameters, I get a 'cannot find the macro....'

> Is there anyway to stick this somewhere so I can clean up
> a daily import table?



Tue, 03 May 2005 05:22:16 GMT  
 Changing fieldsize in code
At a friends suggestion, I found a MUCH simplier solution.  Since I cannot
control the export file from the other location, I imported the file as a
table, changed the fields to be what I want, then wrote code to import the
excel spreadsheet into the existing table (I have a delete query tied to the
event as well)

-Alan


Quote:
> I would call the function from code, rather than binding it an event on a
> form. Altering data types/tables are best handled this way. FWIW... You
> could even call it from VBA from thte event, you shouldn't put it directly
> in the Event's signature in the Properties window.

>  -- Dev



> > I have found a partial solution on Microsofts site -
> > Q128016 where you build a function
> > (AlterFieldType "PROD1", "UnitsInStock", "LONG")
> > that does the steps that Alex describes, however If I put
> > it in code tied to an event, I get Expected varaible or
> > procedure, and if it put it directly into the Event
> > parameters, I get a 'cannot find the macro....'

> > Is there anyway to stick this somewhere so I can clean up
> > a daily import table?



Thu, 05 May 2005 06:03:16 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Change fieldsize via code

2. Changing Fieldsize in attached Tables with Code

3. Changing Access97 Fieldsizes with Code

4. Change FieldSize property

5. How to change fieldsize with DAO/VBA?

6. Changing Fieldsize in a Table with data with VB5

7. decimal datatype fieldsize

8. ***KeyStrokes and FieldSize***

9. Help with fieldsize

10. DAO 3.1/ODBC Direct, .FieldSize incorrectly returns -1

11. Modifieing Fieldsizes in MDB-Databases with VB

12. fieldsize in ado ?

 

 
Powered by phpBB® Forum Software