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  

Paste text to form



 
 
Thread Tools Display Modes
  #1  
Old December 17th, 2009, 12:14 AM posted to microsoft.public.access.forms
Stephen sjw_ost
external usenet poster
 
Posts: 21
Default Paste text to form

I have an interesting request that I am trying to figure out how to do. Let
me explain a little first.
I get lists of numbers sent to me for an exclusion process that I am having
to enter each number manualy into the main database for the exclusion to be
effective. I want to automate this process.

I have created a DB that can hold the numbers and I have created the code to
be able to produce the kind of file needed to automate the end of this whole
process.

What I am needing to find out how to do is; I want to be able to copy the
numbers sent to me into a form, click a cmd button and have the numbers input
into my table. When I try to do this using a text box, the entire text box is
treated as the string that it is and everything from the text box gets
updated to 1 field. I need each individual number from the text box to be
updated to its own field in the table.

Is there a way to do this? I hope I am making sense.
Any help or suggestions are greatly appreciated.
--
Stephen
  #2  
Old December 17th, 2009, 01:10 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Paste text to form

There are the Left, Mid and Right functions that can help with this.
If the string you paste always has the same number of characters, this makes
it easier.

Here is some code written in a way that is more straight forward to
understand than if I had written some complicated looping code.
To get the 1st character,
Left$(strTxt,1)
Where strTxt is the string you are copying into the database.
Me.[ControlName1] = Left$(strTxt,1)

To get the next character,
Me.[ControlName2] = Mid$(strTxt,1,1)

ControlName1 is the name of the textbox that will accept the 1st character.
It should be bound to the table field that the 1st character will go into.

ControlName2 is the name of the textbox that will accept the 2nd character


Search in vba help for Left, Mid and Right functions for examples.

Replace ControlName with your object names.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


"Stephen sjw_ost" wrote in message
...
I have an interesting request that I am trying to figure out how to do. Let
me explain a little first.
I get lists of numbers sent to me for an exclusion process that I am
having
to enter each number manualy into the main database for the exclusion to
be
effective. I want to automate this process.

I have created a DB that can hold the numbers and I have created the code
to
be able to produce the kind of file needed to automate the end of this
whole
process.

What I am needing to find out how to do is; I want to be able to copy the
numbers sent to me into a form, click a cmd button and have the numbers
input
into my table. When I try to do this using a text box, the entire text box
is
treated as the string that it is and everything from the text box gets
updated to 1 field. I need each individual number from the text box to be
updated to its own field in the table.

Is there a way to do this? I hope I am making sense.
Any help or suggestions are greatly appreciated.
--
Stephen



 




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


All times are GMT +1. The time now is 02:32 PM.


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