Combo Box rewrites my data!!

  • Thread starter Thread starter pugus
  • Start date Start date
P

pugus

Guest
I have an ADP project setup that's links to a sql server 2000 database.
I have two tables - Missionaries and Boards.
They are linked in a one-to-many relationship (one Board per Missionary, many Missionaries per Board).
I am running a form that is based on a view (FullView). FullView contains the fields from Boards and from Missionaries. I want my form to have a combo box that draws the Board names from Boards (not from FullView, because sometimes not all the Boards will be assigned to a Missionary).


However, when I setup my source for the combo box to be:

SELECT BoardID, BoardName FROM Boards ORDER BY BoardName

and set my "Bind Column" to 1, then I go to form view and select a board from the list and move to the next record, my BoardName value is rewritten with the BoardID value.

Am I making any sense? Can anyone help?
 
Combo

The column count of a combo box starts at 0.
Setting the bound column at that value may do the trick.
 
Thanks, trucktime.
That solved my problem, but now another one has appeared. (maybe I shoud start a new thread?)

In my main form, I have the combo box that links to the BoardFK column of FullView (a view). When I choose a value from this combo box, the subform information also should change to reflect my choice. In order to do this, I added VB code to the AfterUpdate event of the combo box in the main form.

Private Sub Boardcombo_AfterUpdate()
Refresh
End Sub

Except, this code refreshes the main form as well as the subform, so it send me back to the first record of the main form.

How can I only refresh the subform, so I don't lose my place in the main form?



I've tried

Me.BoardsSub.Form.Refresh

but it does nothing.
 
Code:
Me.BoardsSub.Form.RecordSource.Requery
 
Code:
Private Sub Boardcombo_AfterUpdate()
Me.BoardsSub.Form.RecordSource.Requery
End Sub

This doesn't work either. When I make a new selection with my combo box, the whole form blinks, but the subform doesn't update again unless I manually click "Refresh", and even then, it still navigates me back the the first record of the main form.
 

Users who are viewing this thread

Back
Top Bottom