Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Refresh form and open record

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Refresh form and open record
Alex 05.09.2006 02:52:02
I have a form, which has a query containing left joins for a data source.
After I update a combo box field on the form, I need the other
controls/fields on my form to update. I have tried the following different
codes in the combo box field's AfterUpdate event and nothing works. I can
get the form to refresh, but it jumps to the first record. I can get the
form to refresh and open, but it filters the recordset to only the refreshed
record. Can someone please help. Thanks.

Me.Requery - does nothing
****************************************
Me.Dirty = False
DoCmd.OpenForm strDocName, , , strWhere - does nothing
*******************************************
strDocName = "NewPartInputfrm"
DoCmd.OpenForm strDocName, , , "[ID] = " & IDctr
- record refreshes and open, but it filters the recordset to only the
refreshed record.

End Sub
Re: Refresh form and open record
"krocheck" <keith.rocheck[ at ]gmail.com> 05.09.2006 04:22:01
Alex,

You will want to use the Requery method on each of the fields that you
need refreshed.

Me.ComboBoxName.Requery

Keith

Alex wrote:
[Quoted Text]
> I have a form, which has a query containing left joins for a data source.
> After I update a combo box field on the form, I need the other
> controls/fields on my form to update. I have tried the following different
> codes in the combo box field's AfterUpdate event and nothing works. I can
> get the form to refresh, but it jumps to the first record. I can get the
> form to refresh and open, but it filters the recordset to only the refreshed
> record. Can someone please help. Thanks.
>
> Me.Requery - does nothing
> ****************************************
> Me.Dirty = False
> DoCmd.OpenForm strDocName, , , strWhere - does nothing
> *******************************************
> strDocName = "NewPartInputfrm"
> DoCmd.OpenForm strDocName, , , "[ID] = " & IDctr
> - record refreshes and open, but it filters the recordset to only the
> refreshed record.
>
> End Sub

Re: Refresh form and open record
"J. Goddard" <jrgoddard[ at ]NO_cyberus_SPAM.ca> 05.09.2006 04:56:55
I'm not sure what you are trying to do here - are you using the combo
box the select (go to) a record that you want to display?

Or, if this is not the case, what do you want the other controls on the
form to update to?

John


Alex wrote:

[Quoted Text]
> I have a form, which has a query containing left joins for a data source.
> After I update a combo box field on the form, I need the other
> controls/fields on my form to update. I have tried the following different
> codes in the combo box field's AfterUpdate event and nothing works. I can
> get the form to refresh, but it jumps to the first record. I can get the
> form to refresh and open, but it filters the recordset to only the refreshed
> record. Can someone please help. Thanks.
>
> Me.Requery - does nothing
> ****************************************
> Me.Dirty = False
> DoCmd.OpenForm strDocName, , , strWhere - does nothing
> *******************************************
> strDocName = "NewPartInputfrm"
> DoCmd.OpenForm strDocName, , , "[ID] = " & IDctr
> - record refreshes and open, but it filters the recordset to only the
> refreshed record.
>
> End Sub

Re: Refresh form and open record
Alex 05.09.2006 05:11:01
combo box is a list of all parts from excelAtbl. ExcelAtbl is one of the
tables that is joined in my query with my main table. If a user picks
excelApart 12345 I want the Partweight, for example, which is a field in the
excelAtbl to update on my form. Thank you.

Krocheck's idea didn't work.

"J. Goddard" wrote:

[Quoted Text]
> I'm not sure what you are trying to do here - are you using the combo
> box the select (go to) a record that you want to display?
>
> Or, if this is not the case, what do you want the other controls on the
> form to update to?
>
> John
>
>
> Alex wrote:
>
> > I have a form, which has a query containing left joins for a data source.
> > After I update a combo box field on the form, I need the other
> > controls/fields on my form to update. I have tried the following different
> > codes in the combo box field's AfterUpdate event and nothing works. I can
> > get the form to refresh, but it jumps to the first record. I can get the
> > form to refresh and open, but it filters the recordset to only the refreshed
> > record. Can someone please help. Thanks.
> >
> > Me.Requery - does nothing
> > ****************************************
> > Me.Dirty = False
> > DoCmd.OpenForm strDocName, , , strWhere - does nothing
> > *******************************************
> > strDocName = "NewPartInputfrm"
> > DoCmd.OpenForm strDocName, , , "[ID] = " & IDctr
> > - record refreshes and open, but it filters the recordset to only the
> > refreshed record.
> >
> > End Sub
>
>
Re: Refresh form and open record
"J. Goddard" <jrgoddard[ at ]NO_cyberus_SPAM.ca> 05.09.2006 06:15:43
Is Partweight a field in the query? If so, try putting
me![part weight field] = [Partweight]

Don't call the form control Partweight, it won't work if you do.

Did you try me.repaint? Can't guarantee it will work under these
circumstances - but it might.

John



Alex wrote:

[Quoted Text]
> combo box is a list of all parts from excelAtbl. ExcelAtbl is one of the
> tables that is joined in my query with my main table. If a user picks
> excelApart 12345 I want the Partweight, for example, which is a field in the
> excelAtbl to update on my form. Thank you.
>
> Krocheck's idea didn't work.
>
> "J. Goddard" wrote:
>
>
>>I'm not sure what you are trying to do here - are you using the combo
>>box the select (go to) a record that you want to display?
>>
>>Or, if this is not the case, what do you want the other controls on the
>>form to update to?
>>
>>John
>>
>>
>>Alex wrote:
>>
>>
>>>I have a form, which has a query containing left joins for a data source.
>>>After I update a combo box field on the form, I need the other
>>>controls/fields on my form to update. I have tried the following different
>>>codes in the combo box field's AfterUpdate event and nothing works. I can
>>>get the form to refresh, but it jumps to the first record. I can get the
>>>form to refresh and open, but it filters the recordset to only the refreshed
>>>record. Can someone please help. Thanks.
>>>
>>>Me.Requery - does nothing
>>>****************************************
>>>Me.Dirty = False
>>>DoCmd.OpenForm strDocName, , , strWhere - does nothing
>>>*******************************************
>>>strDocName = "NewPartInputfrm"
>>>DoCmd.OpenForm strDocName, , , "[ID] = " & IDctr
>>> - record refreshes and open, but it filters the recordset to only the
>>>refreshed record.
>>>
>>>End Sub
>>
>>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net