Non Recordsource - Does not update with the row

2019-09-07 05:07发布

问题:

I have a form that i am using to input information into a table.

Table Definition:

Field0 - AutoNumber
Field1 - Text
Field2 - Number (Loose Referential Integrity)
Field3 - Number (Loose Referential Integrity)

Control - Record Source:

TextBox - Field1
ComboBox1 - `Unbound`
ComboBox2 - Field2
ComboBox3 - Field3

In regards to the Form:

New Record - ComboBox1 defines the selections available in ComboBox2
Edit/View Record - ComboBox1.Value is deduced by the ComboBox2.Value

Originally, this Form was designed with Single Form layout, but the end-user wanted more of a Continuous Form layout and now when i view the list of values, ComboBox1 is the same value acrossed all Rows. I was originally using the Form_Current event to handle the backward's inheritence to derive the Value of ComboBox1 from ComboBox2. This is not quite working like it originally did when it was a Single Form.

How do i migrate a Single-Form Form_Current methodology to a Continuous Form logic so that each row is evaluated as its own single entity?

Currently, if i go look at a single row, it evaulates ComboBox1 from ComboBox2 but it evaulates all of the rows in the Continuous Form not just the row i happen to currently be on.

回答1:

This is a question that keeps coming up. You cannot sensibly use unbound controls in a continuous form. There are various work-arounds, according to what you are doing. The best is usually leave the editing to a pop-out form.

Alternatives include setting a textbox to the bound value and just marking the comboboxes "edit such-and-such".