Hi all,
I am working on a part of a database but something is going wrong with my Dlookup function.
I have a form called FST_main. On this form is an option group called "OG_status". The selected value in OG_status is used for a Dlookup is a table called "status".
On the same form is textbox "Sel_st" which should return the corresponding value from the table (when the command button is clicked).
I used VBA for this because in a later stage I'd like the use the return values from Dlookup as a query criteria.
As a return I only get "you canceled the previous operation"
Can somebody help me with this.
I am working on a part of a database but something is going wrong with my Dlookup function.
I have a form called FST_main. On this form is an option group called "OG_status". The selected value in OG_status is used for a Dlookup is a table called "status".
On the same form is textbox "Sel_st" which should return the corresponding value from the table (when the command button is clicked).
I used VBA for this because in a later stage I'd like the use the return values from Dlookup as a query criteria.
Code:
Dim strS_select As Variant
strS_select = Me.OG_status
Me.Sel_st = DLookup("[Status]", "Status", "[Status ID] = strS_select")
Can somebody help me with this.