After Update - If specific result?

G

Guest

Here's my current AfterUpdate on a ComboBox:

Private Sub cboProductFamily_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
'Stop
rs.FindFirst "[Product_ID] = " & Str(Nz(Me![cboProductFamily], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

...currently working like a charm with two minor problems. First, when the
form opens the Combobox comes up blank, so I am getting a message asking for
Product_ID used elsewhere on the main form.

The MAJOR issue I want to address is the fact that one of the items in the
Product Family table is "*All". As the value of the ComboBox determines what
company names are to be displayed in the Subform that is next in sequence,
you may have guessed that "*All" is the istruction to put them ALL in thar.

In VFP I would expect a construct something like ..

txtSomeVar = IIF(ProductFamily.Product_Family =
"*All",txtSomething,txtSomethingElse)

... and then use txtSomeVar to do the job that was formerly being done by the
exposed value of the ComboBox.

So how do I do this in Access?
 
G

Guest

Ooops -- getting old, getting sleepy. Forget all that nonsense about the *All
part I just needed some more rows in the child table.

The IIF thingy is important, though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top