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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date format and Management form !!!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I using VBA code environment and SQL Server database.
I have two problems, i don't know how to do.
The first:
- I usually input date with (mm/dd/yyyy), but sometimes i want to input date (mm/yyyy). How to do this on the same field.
The second:
- In my program have many forms, how to manage form. Example: When form2 is opened by form1 i don't want form1 appear, but form2 is closed then form1 displayed (Note: form1 can open many forms).
Please help me. Thanks very much.
Ger
 
I usually input date with (mm/dd/yyyy), but sometimes i want to input date (mm/yyyy). How to do this on the same field.

you can't. how about putting it in with day = 01? will that satisfy you?

as for your forms, in your OnClick code for the button put, for example,

DoCmd.Close acForm, "Form1", acSaveNo


g
 
Sorry, can you explain for me about form management once more? I don't understand you very well. Can you give me an example? I want to check form status after other forms are opened.
Example: Form2 is opened by form1, form3 is opened by form2. When form3 is closed then i want from2 is displayed. Similar for other cases.
 
Thank you very much.
But can you explain for me about form management once more? Can you give me an example? I want to check form status after other forms are opened.
Example: Form2 is opened by form1, form3 is opened by form2. When form3 is closed then i want from2 is displayed. Sometimes from3 also is opened by form1, in this case when form3 is closed then form1 is displayed. Similar for other cases.
Ger
 
You could do something like this.
In Form1
dim LinkCriteria as string, DocName as string
LinkCriteria = "Form1"
DocName = "Form1"
DoCmd.Close
DoCmd.OpenForm DocName, , , , , , LinkCriteria

In Form2
OnOpen Event
Public FormFrom as string
FormFrom = me.OpenArg

OnClose Event
dim DocName as string
DocName = "Form2"
If FromFrom = "Form1" then
DoCmd.Close
DoCmd.OpenForm DocName
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top