PatKung
asked on
Need code that does the same as hitting the F5 key
Could someone give me what the code should be to do the same thing as hitting F5 and the event to put it in. I have two text boxes on my form. The first one I choose what FY I want, the next drop down should limit my choices based on the FY I choose but it doesn't unless I hit F5.
Thanks, Pat
Thanks, Pat
ASKER
That didn't work.
Here is what I had on the Row Source for the second Combo:
SELECT DISTINCT tbl_05_TypeInvoice.strType Inv FROM tbl_05_TypeInvoice INNER JOIN tbl_01_Main ON tbl_05_TypeInvoice.strType Inv=tbl_01 _Main.strT ypeInv WHERE (((tbl_01_Main.intFY)=Form s!frm_05_I nvoiceGen! txtChooseF Y)) ORDER BY tbl_05_TypeInvoice.strType Inv;
I removed it and put on the first Combo in the afterupdate:
Private Sub txtChooseFY_AfterUpdate()
Me.txtTypeInv.RowSource = "select intFY from tbl_01_Main where [intFY]= " & Me.txtChooseFY
End Sub
Chose 2007 on the first Combo, the second one gave me a string of 2007. What I should have gotten was the five different types of invoices that exist with a FY of 2007.
Did I do something different than you said?
Thanks, Pat
Here is what I had on the Row Source for the second Combo:
SELECT DISTINCT tbl_05_TypeInvoice.strType
I removed it and put on the first Combo in the afterupdate:
Private Sub txtChooseFY_AfterUpdate()
Me.txtTypeInv.RowSource = "select intFY from tbl_01_Main where [intFY]= " & Me.txtChooseFY
End Sub
Chose 2007 on the first Combo, the second one gave me a string of 2007. What I should have gotten was the five different types of invoices that exist with a FY of 2007.
Did I do something different than you said?
Thanks, Pat
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That worked, but is there any code that just does what the F5 does that I could use when needed?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That worked perfect! And a lot less code. Still did it on the AfterUpdate of the previous ComboBox.
Thanks, Pat
Thanks, Pat
ASKER
Thanks again!!
set the row source of the combo in the after update event of the the first combo
private sub combo1_afterupdate()
me.combo2.rowsource="selec
end sub
if [FY] is text data type use this
me.combo2.rowsource="selec