Rabu, 08 Mei 2013

[MS_AccessPros] Re: Combo Box Not Working

 

Hello Doyce,

Do you believe that the follow lines are failing? (that Me.Bookmark is not being set?)

> rs.FindFirst "[BOMID] = '" & strComboVar & "'"
> If Not rs.NoMatch Then Me.Bookmark = rs.Bookmark

Usually when my trusted code fails it turns out to be data source related (a misspelled column or missing rows).

Bob

--- In MS_Access_Professionals@yahoogroups.com, "dnwinberry" <winberry.doyce@...> wrote:
>
> Hello Friends,
>
> I have a bound form that I set to open without a record showing. I usually select the record from a combo box. However, I can't figure out why this code I've used many times before will not work on this form.
>
> Private Sub cboUnitID_AfterUpdate()
> ' Find the record that matches the control.
> Dim rs As Object
> Dim strComboVar As String
>
>
> strComboVar = Me.cboUnitID
> Debug.Print strComboVar
> Debug.Print Len(cboUnitID & vbNullString)
> If Len(cboUnitID & vbNullString) < 0 Then
> Me.Filter = ""
> Me.FilterOn = False
> DoEvents
> Set rs = Me.Recordset
> rs.FindFirst "[BOMID] = '" & strComboVar & "'"
> If Not rs.NoMatch Then Me.Bookmark = rs.Bookmark
> Set rs = Nothing
> End If
>
> End Sub
>
> The form stays filtered at the bottom and I get the correct value and length in the immmediate window when I'm troubleshooting. Could I be missing a reference or something? Nothing appears to happen when I run the code except for what shows up in the immediate window.
>
> Doyce
>

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar