Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

buttom not work

Status
Not open for further replies.

wdu94

Programmer
Aug 15, 2001
61
US
Hello,

I have a form and only have one search combox in the form.

My problem is when I finished selecting combox, the buttom "previous buttom", Next buttom" are not work. But before selecting combox that's works fine.

I don't know what's problem?

Many Thanks.
Jing
 
Hi,
I am not sure if I got your problem right but I believe that what you are talking about are the record navigational buttons??

what type of form is it? is it bound to a table or a view of the DB ?

is the combobox bound to a table or a view as well?

be a little more precise =)

Alcar
 
Hi, Alcar:

Thanks again.
My form is a single form, the form data and combox row source are come from table.

My problem is: When I select item from combox then the form show up the data info. After that, when I click "previous" buttom, I got error messege: "You can't go to the specified record". Before selecting item from combox, the "previous' buttom works fine. What's happen?

Jing
 
Sounds Like your combox box is setting your filter and not bookmarking.

Can you post the code that is in the AfterUpdate_ComboBox() property of the combo box?
 
Alcar,

The following are my codes:

Private Sub Combo18_AfterUpdate()
Dim strSQL as string
strSQL ="select * from Motor_carrier where MC_NUM = ' "& me.Combox & "'"

Me.RecordSource = strSQL
Me.Requery

End Sub
*****************
Thank you very much.
Jing


 
is it possible the recordset is only returning one record, possibly?
 
Yes you are selecting just one record so it can't go to any others. what you want to do is just bookmark the record that you choose from you combobox. Use this code.

Private Sub Combo18_AfterUpdate()
Dim rs as Recordset

Set rs = Me.Recordset.Clone
rs.Findfirst "[MC_NUM] =" & Me.Combo18
Me.Bookmark = rs.Bookmark

End Sub

this will allow your navigation buttons to work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top