This is a discussion on VBA Requery Problems within the Microsoft Access forums, part of the Databases category; Trying my hand at some VBA for the first time I am using the event lost focus to trigger a ...
| |||||||
|
#1
| |||
| |||
| Trying my hand at some VBA for the first time I am using the event lost focus to trigger a requery but I am getting some problems. The requery is unrelated to the form the event is in. The query is named [qry180expincdailynet] I thought to write: requery [qry180expincdailynet] Its not taking it. Anyone know what I am doing wrong? |
|
#2
| |||
| |||
| Maybe if you described why you feel you need to "requery" this query we can help. |
|
#3
| |||
| |||
| I have a form that has a few subforms One subform is an entry form. The other form is a read out of averages and such. what is being entered is finanicial data debits, credits, dates etc. I have a few queries that give me a half year average. An example would be Aveerage deposits and average expenses and average net from both. Obviously these dynasets do not recalc upon new entry but I would like them to do so. I figured a good event would be lost focus. Dont know how I would go about that. Let me know if that is enough info |
|
#4
| |||
| |||
| Assuming the SubForms are bound to the "queries" then you want to requery the *SubForm* rather than the query directly. |
|
#5
| |||
| |||
| cool Ill try that. Do you have any suggestions how I would write that. I am new to using VBA. Would you mind disclosing the statement I would use with an abitrary form name. |
|
#6
| ||||
| ||||
| [Forms]![Parentformname].[Form]![subformname].Requery
__________________ If i helped you, make me famous by clicking the ![]() Status: Currently Unemployed - Looking for Work, Can be contacted on thethresher@hotmail.co.uk |
|
#7
| |||
| |||
| Here's a good link for the syntax to use: Forms: Refer to Form and Subform properties and controls |
|
#8
| |||
| |||
| I did what you wrote and it saying to me that MS access could not find the form 'qry180expincdailynet'. I wrote [forms]![master].[form]![qry180expincdailynet].requery Thanks for helping earlier. Mind shedding some light on why I am addressing the form instead of the query. |
|
#9
| |||
| |||
| Try: FORMS.YourFormName.YourSubFormName.FORM.Requery |
|
#10
| |||
| |||
| Ok Ill try that thanks again |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |