How To Read Value From One Field Into Another

matomo

Registered User.
Local time
Today, 05:20
Joined
Jun 26, 2003
Messages
23
Dear all,

Can somebody please help in solving this problem that I am having.

What I want to do is as follows:

(A) Read the value from this Field FDVPDMB (Text Field)

1. When value is preceeded by an *, characters 2 and 3 should be read and Display in Application Type Field on the Form.

2. When value is NOT preceeded by an *, characters 1 and 2 should be read and Display in Outcome Field on the form.

3. When value is NOT preceeded by an *, only read character 3 and Display in Decision Making Body Field on the form.

(B) Read the value from this FDVPDTE (Numeric Field)

1. When the value in the preceeding field (i.e. FDVPDMB) IS NOT preceeded by an asterisk, value should be read as a date with YYMMDD format and display in Development Outcome Date Field on the form.

2. When the value in the preceeding field (i.e. FDVPDMB) IS preceeded by an asterisk, value should be read as a number and Display in Aplication Number Field on the Form.

I will so much appreciate any help in solving this problem.

I have attaches a copy of the database.

Thanks you all in advance.

matomo:(
 

Attachments

Look up Instr and Mid functions in access help, that should get you going.

To test for "*" in as sting use Instr, and if that expression returns > 0 then the character was found.

Code:
If Instr(Me!FDVPDMB, "*") > 0 Then 
' char was found, do something

To extract form a string using Mid.

SomeField = Mid (Me!FDVPDMB, 2, 3) will take tke 2nd and 3. char from the sting.

Wrap everthing in an If/else statement.

JR
 
Last edited:
JR appears to have left out the Instr() from his code. all you need to check for the asterisk would be

If Left(Me!FDVPDMB,1) = "*" Then
 
Thanks guys. This what I am looking for.

matomo:)
 
JR appears to have left out the Instr() from his code

oops, my bad. Typing and thinking not good bedfellas. :rolleyes:

Also I forgot about Left function.

JR
 

Users who are viewing this thread

Back
Top Bottom