Field copy in Table

Slade2000

Registered User.
Local time
Today, 11:43
Joined
Jan 27, 2009
Messages
30
Howdi.

Im new with access but can help my self.

What i want to do is copy parts of a field into a new field.

For example:

Now:
field1
000011110000

want it to be:
field1 field2
000011110000 1111

Tnx allot.
 
Given what you've posted, the Mid() function should work for you.
 
Given what you've posted, the Mid() function should work for you.

How does this work? do i put it in a query?

I just want to add the field will aloways contain 13 numbers but the numbers differ totaly.

Tnx
 
It can work anywhere, depending on what you're trying to achieve. Have you looked in Help for the syntax?
 
This is how i understan from what the help gives me how it should look like.

Private Sub Command0_Click()
Mid(table1.NSC,2[,2])


End Sub
 
or must it be more like this?

Mid(field1, 2, 2) = field2
 
Where are you trying to use it?
 
Just to go with Paul's responses -

1. You should not be storing this data, if it is the same data (but only partial) from another field.

2. You just get at it when using a query. And, just so you know, you can use a query in 99.99% of the places you use a table, so you do NOT need to store this data IF you still have the other data stored. If you are trying to get rid of the first field and just have the other part, that is different.
 
at the moment just trying with a button, but i dont even get the value of the field into a varuble. this is my code.

Option Compare Database


Private Sub Command0_Click()
Dim aaaa As String
Dim bbbb As String

aaaa = toets.table1.NSC

MsgBox (aaaa)

End Sub
 
I'll sign off, since Bob has arrived to save the day.
 
Just to go with Paul's responses -

1. You should not be storing this data, if it is the same data (but only partial) from another field.

2. You just get at it when using a query. And, just so you know, you can use a query in 99.99% of the places you use a table, so you do NOT need to store this data IF you still have the other data stored. If you are trying to get rid of the first field and just have the other part, that is different.

no dont need want to get rid of it after it is split.

Here is wat exacly must happen and dont have any idea where to start.

i import a text file with different fields. the first field contains a 13 digit number and i want to split this number in 2 to generate 2 seperate numbers. this is an actual sample of a number.

is now:

field1
7110184064714

need it to be:

field1 = 7110184064714
field2 = 7110
field3 = 18-406-4714

tnx.
 
Got it to work. What i need now is how to save the data from the query to the table.
 

Users who are viewing this thread

Back
Top Bottom