TWO questions

Chimp8471

Registered User.
Local time
Today, 05:53
Joined
Mar 18, 2003
Messages
353
Firstly

i have a form with a combo box on it, on the form i have inserted a subform which also has the same combo box on it, what i need to do is when i change one of them the other automatically changes to match.

secondly

i could do with my subform being refreshed every second, is this possibly if so how please

Cheers


Andy
 
On the After Update of the First Combobox add:

[Forms]![subFormName]![ComboboxName] = Me.ComboboxName

Out of curiousity, why do you need the subform to refresh every second? Wouldn't you just need it to refresh when changes are made?

You could add
[Forms]![subFormname].Requery to the Timer Event of the Main form and set the Timer Interval to 1000.
 
i have tried entering the

=[Forms]![Calendar of Attendance]![scrstudent]=[Me].[scrstudent]

in the after update box but when i change the box a grey message box appears, saying it can't find the form Calendar of Attendance, but it is definitly there

Andy
 
What is the name of the Form and the name of the subform?
 
Chimp8471 said:
i have tried entering the

=[Forms]![Calendar of Attendance]![scrstudent]=[Me].[scrstudent]

in the after update box but when i change the box a grey message box appears, saying it can't find the form Calendar of Attendance, but it is definitly there

Andy

Try =[Forms]![Calendar_of_Attendance]![scrstudent]=[Me].[scrstudent]
 
You need to explicitly reference the subform ie

on After_Update of scrstudent (on mainform)
[Forms]![MainFormName]![Calendar of Attendance].Form![scrstudent]=Me.scrstudent

on After_update of scrstudent (on subform)

me.parent.scrstudent = me.scrstudent
 
any chance you can have a look at this for me please, it is my final part of my collegework, i found this attendance thing somewhere on the net but am just trying to modify it to suit my database.

the reason i needed it to refresh is so that it shows the data when the combobox changes.

Cheers

Andy
 

Attachments

Instead of putting the code in the form properties, use Code Builder and enter the following code:

[Forms]![Record Attendance]![Calendar of Attendance]![scrStudent] = Me.scrStudent

I have tested this and it works perfectly.
 
thanks for you advice, but i am a little unsure where to do this, any more instructions would be great
 
Open the properties for the Combo Box and go to the Events tab. Under the after update event, you have entered some code. Delete this and click on the button on the right hand side of the box (it has three dots on it). A box will appear asking you to select either where you want to put your code, select Code Builder. Enter the code I gave you into the After update event in Code Builder.
 
thank you very much,

one last thing with this problem, don't suppose you know how i can get my calandar to display the dates as soons as the persons name appears, as it currently is i need to press the page up or down button for it to be displayed. ideally i would like this to be visible straight away

cheers

Andy
 
Open the Properties for the Combo Box on the subform and select Event Procedure in the after update event.

Now when you select the employee from that combo box, the calendar will update.
 
right i know i sound like a complete buckle now, but i have done what you said, the name link works fine now thanks.

however i have gone into the subform, select the properties of the combobox, selected the event procedure and yet nothing happens, when i looked at the code it says

call refdates

is this right ???


sorry to be such a pain

Andy
 
Yes that's right. It means that whenever you change the user from the Combo Box on the subform, then the Function refdates will run. This function shows the Calendar entries.
 
this only seems to work when i physically change the box within the subform and not when i change it in the main form,
 
That's the only way I could think of to make it work. You can't call the refdates function from the main form because it it part of the other form.

You could maybe copy the refdates function to the main form and call it from there.
 

Users who are viewing this thread

Back
Top Bottom