openargs and perhaps title

H

Henny

I have a form with 4 buttons for searching , adding , editing and delet
records. And for the results I'm using the same Form . I like to change, the
general heading , into the the headingname which form is called. Also by
clicking search-button in the form-heading must be the name "search" and
when adding a record the name "ADD" etc..etc...
Can somebody help me...??

Thank you

Henny
 
H

Henny

I've adjusted the first sentence of my earlier email. It should be ....
I have one form for four button-events one for search, Add , Edit and delete
 
M

MacDermott

Me.Caption is the property to change for the title in the blue bar at the
top of the form.
 
V

Van T. Dinh

I don't entirely follow your description but after you open the second Form,
you can change its Caption to whatever you like.

Check Access VB Help on the Caption Property of the Form.

HTH
Van T. Dinh
MVP (Access)
 
H

Henny

Van T. Dinh
I didn't express myself quite well so I can understand that you could not
follow me. I will try again.
From my choice-form (buttons for records : New, Edit, search and delete) .
Next to this choiceform I want to deal with one form for the results. So
when I press New than the form is comming up (and the name of the form
should be NEW)and I input the new-data. When I press the edit-button . The
same form (as the form for New) must come up , but now with a dialog-name
EDIT etc..etc..

Thank you

Henny
 
V

Van T. Dinh

You you mean you want to change the text in the Title Bar of the called
Form?

If yes, Caption is the Property you want (as per my previous post).
 
H

Henny

OK Van T. Dinh
It should not be a fix text in the title bar, but depending on what form
I've called, the belonging text should appear. So at the moment I've
pressed
The New button , the form must comming up in the title bar with NEW Record
or Add New record and is the choice the EDIT button than EDIT record should
be in the title bar. What do I 've to do in VBA after the Call moment ...?
Where do I place the Me.Caption and where the belonging text in the title
bar...?

Public Function funNieuw(frmForm As Form, frmSubform As Form, strPopupform
As String)
frmForm.Visible = False
docmd.OpenForm FormName:=strPopupform, datamode:=acFormAdd,
windowmode:=acDialog
'At the bottom of strPopupForm there are two buttons OK and CANCEL (as
boolean)
' When field txtID is empty and I press the OK key an error Nb: 94
occured

If blnOK Then
Forms(strPopupform).Visible = True
lngKey = Forms(strPopupform)!txtID
docmd.Close acForm, strPopupform
frmForm.Visible = True
frmForm.RecordSource = frmForm.RecordSource
Else
Forms(strPopupform).Visible = True
docmd.RunCommand acCmdUndo
docmd.RunCommand acCmdUndo
docmd.RunCommand acCmdUndo
docmd.Close acForm, strPopupform
frmForm.Visible = True
End If
 
V

Van T. Dinh

You open the Form using acDialog mode so all the code in the calling Form
will pause. Thus, you cannot add any statement to change the Caption after
the OpenForm statement.

In this case, you need to pass the Caption text through the OpenArgs
argument and use the Form_Load Event of the of thecalled Form to change its
Caption with the text from the OpenArgs.
 
H

Henny

Thanks van T Dinh
I did pass the titletext via Openargs. You've brought me at the right
solution.

Henny
 
Top