L
Lara
In the Combo Box Wizard, I've chosen to "find a record in
my form based on the value in the combo box." When I'm
done, this is the event procedure the wizard creates for
me, after update:
Private Sub Combo69_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Company] = '" & Me![Combo69] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
HOWEVER, we have company names WITH apostrophes in them.
When we choose one of those companies, the macro dies
("run time error 3077, syntax error(missing operator) in
expression") Can I rewrite this code to work with those
companies as well, or do I just have to make a rule that
they can't use apostrophes in the company name? The user
tells me he's having a similar problem with the "&"
symbol, but I haven't been able to duplicate it, so if
you happen to know why this is, too, I'd sure appreciate
the help! Thanks :~)
my form based on the value in the combo box." When I'm
done, this is the event procedure the wizard creates for
me, after update:
Private Sub Combo69_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Company] = '" & Me![Combo69] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
HOWEVER, we have company names WITH apostrophes in them.
When we choose one of those companies, the macro dies
("run time error 3077, syntax error(missing operator) in
expression") Can I rewrite this code to work with those
companies as well, or do I just have to make a rule that
they can't use apostrophes in the company name? The user
tells me he's having a similar problem with the "&"
symbol, but I haven't been able to duplicate it, so if
you happen to know why this is, too, I'd sure appreciate
the help! Thanks :~)