You can run this code on the current event of the form instead of the got
focus for the combo.
I have not heard of using the full reference to the combo to avoid a crash
with SP3 before today.
Private Sub Form_Current()
With Me
If fOSUserName() = .WorkerID Then
.Category.Locked = False
Else
.Category.Locked = True
End If
End With
End Sub
If you wish to use full references,
Private Sub Form_Current()
With Forms![Form1]
If fOSUserName() = .WorkerID Then
.Category.Locked = False
Else
.Category.Locked = True
End If
End With
End Sub
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
"Iram" <(E-Mail Removed)> wrote in message
news:15C1C64A-9FAA-4BA6-9FAE-(E-Mail Removed)...
>I read an article that indicates using Me. when using vba on a Combobox
> causes crashes and to replace Me. with the full references to the form
> path,
> i.e.
> Private sub...
> Forms![form1]![Combo2].whatever
> End Sub
>
> Since I don't know vba too well how would I re-write the following to
> remove
> the Me stuff to full form references?
>
>
> Private Sub Category_GotFocus()
> With Me
> If fOSUserName() = .WorkerID Then
> .Category.Locked = False
> Else
> .Category.Locked = True
> End If
> End With
> End Sub
>
>
> Thanks.
> Iram
>
>
>
>
> "Iram" wrote:
>
>> Hello,
>> I have many combo box's in many forms that continue to cause Access 2003
>> SP3
>> to crash.
>>
>> Are there any official bugs on MS web page that describe why? If so can
>> you
>> send me a couple of links.
>> These combobox's are pretty embarrasing and frustrating.
>>
>> ------------Below is the query the combo box runs, can you tell me if you
>> see anything wrong?
>>
>> SELECT tbl_Category.Category, tbl_Category.Classification,
>> tbl_Category.Category, tbl_Category.Desc, tbl_Category.ReportType AS
>> [Category-Type], tbl_Category.[Remove Category]
>> FROM tbl_Category
>> WHERE (((tbl_Category.[Remove Category])=0))
>> ORDER BY tbl_Category.Classification, tbl_Category.Category;
>>
>>
>> --------Below is the On Got Focus of the same combo box...
>>
>> Private Sub Category_GotFocus()
>> With Me
>> If fOSUserName() = .WorkerID Then
>> .Category.Locked = False
>> Else
>> .Category.Locked = True
>> End If
>> End With
>> End Sub
>>
>>
>>
>> Thanks.
>> Iram/mcp
|