Editable Default Value From Lookup Module (1 Viewer)

belly0fdesire

Registered User.
Local time
Today, 11:49
Joined
Dec 1, 2005
Messages
11
I'm still learning here, so please don't get annoyed if I don't know what I'm talking about.

I have a Module that I created that looks up a value in a table.. It is shown below.

Code:
Public Function DescLookup()

    DescLookup = DLookup("[Projdescription]", "ProjDescTable", "[OrderN] = [Forms]![Production]![ProjIncList]")
End Function


I want this to be the default value for a field, however I want the field to be editable and I will later have a button that calls on an update query that will update the field with whatever changes are made to the Text Box, however when I set DescLookup() as the default value of the text box, it will not let me edit the text box in the form.

Am I describing this correctly? Can anyone help?
 

MarkK

bit cruncher
Local time
Today, 11:49
Joined
Mar 17, 2004
Messages
8,186
Have you set the DefaultValue of the control or the ControlSource? I suspect the latter.
In the form open event, assign the value of the function to the DefaultValue property of the control.
Code:
Me.tbMyText.DefaultValue = DescLookup
 

belly0fdesire

Registered User.
Local time
Today, 11:49
Joined
Dec 1, 2005
Messages
11
Thank you very much. That worked perfectly!
 

Users who are viewing this thread

Top Bottom