Updating from a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I have a form inside another form, in this form i have several dates listed
down with startdate and enddate as two fields. Its working allright, now i
have done it so when i click on a date then i open another form where i have
a Calendar, and when i click on a date in this calendar i should change the
date in my form, but i can only change the first date, if i click on maybe
number 3 date it is still number 1 date there got change how can i make it so
when i click on a date(field) in the list i have in my form i get the right
date

Alvin
 
Your popup calendar form neess to know which date control opened it. The best
way is to use the Docmd.OpenForm's OpenArgs property.

Docmd.OpenForm "CalendarPopUp", OpenArgs:="txtDateFrom" 'or whichever
control opens it.

In the calendar form's event that closes it, set the calling control's value
with:
Forms!MainForm.Controls(Me.OpenArgs) = Me.myCalendarControl.Value

Barry
 
Thanks barry
Well iget the first to work but not the update i get a error:
My form name is
form_q_datoer_tilretteplan
in this form i have to fields
startdato and slutdato

By click its open my calendar form:
form_kalender_slut
in this form i have
a calendar call:
slut_call

so maybe you can help again??

Alvin

"Barry Gilbert" skrev:
 
Hi me again

I try
Form_q_datoer_tilretteplan.Controls(Me.OpenArgs) = Me.slut_cal.Value

its working fine when i open the calendar by clicking i get the right date
in the calendar form, but change dosn't work.

when i click on number 2 date its also change my 1 date

Regards
alvin



"Barry Gilbert" skrev:
 
You need to pass in the name of the control that you want to fill. Let's
assume you are using the textbox's DoubleClick ebent to trigger the calendar
popup. In the startdato_DoubleClick event, put:

DoCmd.OpenForm "form_kalender_slut", OpenArgs:="startdato"

In the slutdato_DoubleClick event, put:
DoCmd.OpenForm "form_kalender_slut", OpenArgs:="slutdato"

Notice the the OpenArgs property is different between the two? This is what
tells the calendar form which control to fill.

Barry
 
I think I just noticed that you have two calendar controls on your calendar
form. Is this correct? If this is true then my previous post won't work.

Barry
 
Hi barry
Thanks
I got the first to work
so when i click on a date in the field of my form i get the right date in my
calendar form, but i can't make it to change the right date in my form, it
allways just cgnage the first date.
Maybe i'm doing somthing wrong from the start? i open a form with a calendar
inside, but maybe i can open a popupcalendar without making a form to this?

Anyway in my cakendar form call:
kalender_slut i have a calendar call slut_call
in slut_call i have in the enter event write
slut_cal.Value = Form_q_datoer_tilretteplan.SlutDato

this working so when i click on a date in Form_q_datoer_tilretteplan.SlutDato
then i get the right date in slut_call

i can't making to work with me.OpenArgs

regards
Alvin



"Barry Gilbert" skrev:
 
No i have a form with my start calendar
and a form with my slut calendar

But i have change it now so i can see the calendar in the form
ITS working.
Thanks for the help

Alvin


"Barry Gilbert" skrev:
 
Alvin,
Forward your mdb to me and I'll take a look at it.

blgilbert at gmail dot com

Barry
 
Great! I'm glad it worked.

Barry

alvin Kuiper said:
No i have a form with my start calendar
and a form with my slut calendar

But i have change it now so i can see the calendar in the form
ITS working.
Thanks for the help

Alvin


"Barry Gilbert" skrev:
 

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

Back
Top