Access Question

Status
Not open for further replies.

deep_sky

Ars Tribunus Angusticlavius
6,421
Subscriptor
I have a main form with subforms displayed as datasheets on a tab control. What I want to know is how to refresh the data shown in the datasheet after a record has been added via visual basic. The record is added at the top of each hour. However, the datasheet does not reflect that addition. I have just about run out of ideas on how to do this.
 

deep_sky

Ars Tribunus Angusticlavius
6,421
Subscriptor
doesnt work, sorry :(

it says it cannot find the name of the form i have listed. as i have checked the spelling and the format of the command and it is as it should be, i am forced to conclude that the requery command does not work with an open subform.

i have tried requery, refresh, tried closing and opening the subform (access seems to ignore any arguments to the close method so it closes out the entire set of forms), and access tells me it cant find the form or i cannot use the applyfilter method.

the situation is this:
i have a form that has a tab control on it. the tab controls each have a subform. each subform has as its record source a part of a table (the table is freaking huge and exceeds access's ability to display it all one one form correctly.). i want to create a record at the top of each hour automatically, which i have done so sucessfully. i want all the subforms to update to reflect the new record created in code. i thought a simple requery would suffice but apparently its not. now is there something wrong with my install of access possibly or does requery do not work in this situation? i am using access 2000.

thanks
 
nope.. i think there's nothing wrong with you installation instead i think its great that you use ms Access 2000.

I primarily use ms Access 97... but anyway.... try this one... if you haven't already... its a slight modification.. instead of "me!" try "me."

Code:
 Me.[dbo_month_year_master SubForm].Requery

that's one of the ways i did it.

for the subform name not found thinggy... try check the name.(i think you tried it already)..

anyway.. that's my 0/02 cents..

;)
 
glad i can help...

anyway here are the explanation as taken from ms Access 97 help file/index...



Use the ! and . (dot) operators in expressions

You use the ! and .(dot) operators in an identifier to indicate the type of item that immediately follows.
The ! operator indicates that what follows is a user-defined item (an element of a collection). For example, use the ! operator to refer to an open form, an open report, or a control on an open form or report.

Identifier Refers to
Forms![Orders] The open Orders form
Reports![Invoice] The open Invoice report
Forms![Orders]![OrderID] The OrderID control on the open Orders form

The . (dot) operator usually indicates that what follows is an item defined by Microsoft Access. For example, use the . (dot) operator to refer to a property of a form, report, or control.

Note You can also use the . (dot) operator to refer to a field value in an SQL statement, a Visual Basic for Applications method, or a collection. For example, the identifier Forms![Orders].Controls refers to the Controls collection of the Orders form. However, because the Controls collection is the default collection for forms and reports, it's usually not necessary to refer to it explicitly.

end of quote..

i also get confuse between the 2 sometimes
enjoy ms access programming.. :0)

kuman :D
 
Status
Not open for further replies.