|
|
Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
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
|
|
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
|
|
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
|
|
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 > >
|
|
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 >> >>
|
|
|