Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing the form if condition matches!

Status
Not open for further replies.

Koaz

Programmer
Nov 26, 2002
15
SG
Hi all,

I have a question here. How could close the form when condition is true. For example, if the condition require appear to be true and done, the form will close.

I only know that, in visual Basic is 'End'. But it don't work in Ms Access.

Thanz n i do appreciate any help from the folk!
 
Hi Kaoz,

I dont really know exactly what you are referring to in this question, however you could do a simple IF statement and test for the condition. And then use the "docmd.close" command.

eg. if (condition1 = True) then
docmd.close
else
msgbox "condition1 is false"
end if

Hope this helps,

Paul

 
I paste my sample code here:

sub cmdBtn_click()
' the form will close lor

my form name is Leave_form. How would close that form.

 
i tried, but it doesn't work. It say type mismatch?
How??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top