A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Requery of a single row in a subform



 
 
Thread Tools Display Modes
  #1  
Old August 25th, 2005, 10:53 AM
Loris
external usenet poster
 
Posts: n/a
Default Requery of a single row in a subform

Hi all,
in a subform I created I want the list of the possible values in a combobox
(Account_ID) to be updated depending on the value selected in another
combobox (Account_Type).
The main problem I am having is that the value is updated in all the rows of
the subform, while I want to update only the current row.

How to do so?

I am using a code like this:

Private Sub Account_Type_AfterUpdate()
Dim strSQL As String
strSQL = "Select Account_Description,Account_ID from Account where
Account_Type='"
strSQL = strSQL & Me!Account_Type.Column(1) & "' order by
Account_Description"
Me!Account_ID.RowSourceType = "Table/Query"
Me!Account_ID.RowSource = strSQL
Me!Account_ID.Requery
End Sub

Thanks in advance.
  #2  
Old August 25th, 2005, 04:27 PM
Wolfgang Kais
external usenet poster
 
Posts: n/a
Default

Hello Loris.

"Loris" wrote:
in a subform I created I want the list of the possible values in a
combobox (Account_ID) to be updated depending on the value selected
in another combobox (Account_Type).
The main problem I am having is that the value is updated in all the
rows of the subform, while I want to update only the current row.

How to do so?


Not at all, because if you change an "unbound property" (other than
the value) of a control in a continuous form, this affects "the control"
whitch is the same in all rows of the form.

I am using a code like this:

Private Sub Account_Type_AfterUpdate()
Dim strSQL As String
strSQL = "Select Account_Description,Account_ID from Account where
Account_Type='"
strSQL = strSQL & Me!Account_Type.Column(1) & "' order by
Account_Description"
Me!Account_ID.RowSourceType = "Table/Query"
Me!Account_ID.RowSource = strSQL
Me!Account_ID.Requery
End Sub


You could try to change the RowSource of the second combo also every
time the user moves to another record, that is in the "current" event of
the subform.

--
Regards,
Wolfgang


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form, Subform, Tab key 2nd_Stage_User Using Forms 17 August 25th, 2006 12:30 AM
Requery method for combobox on subform dgreen Using Forms 3 July 1st, 2005 07:14 PM
Requery Subform A from Subform B Robert_L_Ross Using Forms 6 June 24th, 2005 12:11 AM
Requery(?) subform records Dave General Discussion 1 May 19th, 2005 06:26 AM
dlookup miaplacidus Using Forms 9 August 5th, 2004 09:16 PM


All times are GMT +1. The time now is 02:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.