controlsource property

B

Bret

I am an Access developer in Access 2002.
A simple code below in my form_load code is not running.
I've debug the code and it walks thru with no problem but when
I open the form, the control source is not pointing to the field I've
directed it too.


Private Sub Form_Load()
Dim strLevel as string
strLevel = "VP"


Select Case pubTitle
Case "DOS"
Me.Txt_Lock.ControlSource = "Field1"
Case "VP"
Me.Txt_Lock.ControlSource = "Field2"

End Select

End Sub

thank you.
 
P

PC Datasheet

If pubTitle does not vae a value of DOS or VP neither Case statement will
execute. You might consider adding a default value of DOS ot VP to pubTitle
or adding a Case Else statement to your Select Case procedure.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
[email protected]
www.pcdatasheet.com

If you can't get the help you need in the newsgroup, I can help you for a
very reasonable fee. Over 1000 Access users have come to me for help.
Need a month calendar or 7 day calendar? Need appointment scheduling? Need
room reservations scheduling? Need employee work scheduling? Contact me!
 
Top