how to clear a form field programmatically?

M

Maciej Paras

Hello!
My name is Maciej, and I'm from Poland... I turn to you with this question:
I created a combobox in a form. One of values availabe in this combo is
opening another subform. I want to set the value of that combo to be empty
afer opening the subform. This is the code I've written so far:

Private Sub Combo44_BeforeUpdate(Cancel As Integer)
If Combo44 = "Value I wanted" Then

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "My subform"
DoCmd.OpenForm stDocName, , , stLinkCriteria
'------ And here is the place I want the combo to be cleared from "Value I
wanted"
End If
End Sub

What is the statement of such insertion of an empty field?
Thank you, with kind regards, Maciej Paras
 
M

Maciej Paras

Thank you, thank you, thank you!!!
This worked excellent, but in fact I had to put the expression "Me.Combo44 =
Null" in AfterUpdate event.
Satisfied user ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top