Default value

P

piku

hello!

I put in new form two fields of Date.
when i set value in the first date i want the default value in the second
date will be the value of the first date but i want can to change it.
In the properties of the second date i put "=[FirstDate]" but when i am
enter a value in the first he don't copy it to the second.

I need it work from the properties! I think It must...
what I can do?
 
K

kc-mass

Hi,

Try this: In the afterupdate event of txtFirst Date enter code as "
txtDateSecond = txtDateFirst"

Regards

Kevin
 
P

piku

it's not working...

i tried create new macro with SetTempVar func but he didn't do it.
the argument is: [SecondFeild],[FirstField]

what i can do?

kc-mass said:
Hi,

Try this: In the afterupdate event of txtFirst Date enter code as "
txtDateSecond = txtDateFirst"

Regards

Kevin

piku said:
hello!

I put in new form two fields of Date.
when i set value in the first date i want the default value in the second
date will be the value of the first date but i want can to change it.
In the properties of the second date i put "=[FirstDate]" but when i am
enter a value in the first he don't copy it to the second.

I need it work from the properties! I think It must...
what I can do?


.
 
K

kc-mass

Hi Piku,

Do this. In design view of the form right click on the first date field.
Click on the
"Properties" then Events Tab; click on the line next to "After Update". A
button
with 3 dots will appear to the right of that line. Click on that button.
The system
ill ask if you want to invoke the "Expression Builder" or "Macro Builder" or
"Code Builder". Click on code builder. It will present you with something
like:

Private Sub FirstDateBox_AfterUpdate()

End Sub

Add a line in between the two above lines like

Private Sub FirstDateBox_AfterUpdate()
txtDateSecond = txtDateFirst
End Sub

Change the above "txtDateSecond = txtDateFirst" to include
your first and second text boxes.

Save the code and form.

Regards

Kevin




piku said:
it's not working...

i tried create new macro with SetTempVar func but he didn't do it.
the argument is: [SecondFeild],[FirstField]

what i can do?

kc-mass said:
Hi,

Try this: In the afterupdate event of txtFirst Date enter code as "
txtDateSecond = txtDateFirst"

Regards

Kevin

piku said:
hello!

I put in new form two fields of Date.
when i set value in the first date i want the default value in the
second
date will be the value of the first date but i want can to change it.
In the properties of the second date i put "=[FirstDate]" but when i am
enter a value in the first he don't copy it to the second.

I need it work from the properties! I think It must...
what I can do?


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top