A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

From Text to Date/Time



 
 
Thread Tools Display Modes
  #1  
Old October 29th, 2004, 09:54 PM
Deb
external usenet poster
 
Posts: n/a
Default From Text to Date/Time

Using a macro, I am importing a text file into an access table. I have a
query which reformats the date fields into the proper format, but now I need
a way to change the field type from text to date/time. Can this be done
using a macro?

All help much appreciated!


  #2  
Old October 29th, 2004, 09:59 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default

No, it can't. Changing field types isn't that straightforward at the best of
times, and a macro certainly isn't capable of it.

The usual way is to add a new field, of the correct type, to your table, run
an Update query to transfer the data from the old field to the new field,
delete the old field and rename the new field. This is actually what Access
does under the covers when you make such changes through the GUI.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Deb" wrote in message
...
Using a macro, I am importing a text file into an access table. I have a
query which reformats the date fields into the proper format, but now I

need
a way to change the field type from text to date/time. Can this be done
using a macro?

All help much appreciated!




  #3  
Old April 28th, 2005, 02:42 AM
Chippa
external usenet poster
 
Posts: n/a
Default

Doug,
So are you saying there is no possible way to automate those sequence of
events as a macro? What about in VBA?

"Douglas J. Steele" wrote:

No, it can't. Changing field types isn't that straightforward at the best of
times, and a macro certainly isn't capable of it.

The usual way is to add a new field, of the correct type, to your table, run
an Update query to transfer the data from the old field to the new field,
delete the old field and rename the new field. This is actually what Access
does under the covers when you make such changes through the GUI.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Deb" wrote in message
...
Using a macro, I am importing a text file into an access table. I have a
query which reformats the date fields into the proper format, but now I

need
a way to change the field type from text to date/time. Can this be done
using a macro?

All help much appreciated!





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A challenging question on text boxes-word 2000 fw76 Page Layout 16 October 18th, 2004 11:45 PM
find a date on sheet 2 and count text in that column jtinne General Discussion 4 October 4th, 2004 09:06 PM
Too many hyperlinks? [email protected] Powerpoint 7 May 25th, 2004 02:19 AM
Column separator crosses through wrapped text box Bob S Page Layout 0 April 25th, 2004 09:52 PM
Extracting text Nemo Worksheet Functions 3 April 6th, 2004 02:33 PM


All times are GMT +1. The time now is 12:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.