If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
how to set form properties in vba access 2007
I have cross posted this response to your question to the appropriate Access
newsgroups where you will be more likely to receive the information you require. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Elijah" wrote in message ... Hello, I have to work on something in access and I am use to VB.net. In a VB winform I can have something like this Private m_Firstname As String Public Property Firstname ... End Property and when you want to set this before your form opens you just: Dim f as new frmSomeForm f.Firstname = "raz" f.Show This doesn't seem to work the same way in Access 2007. I am able to make properties basically the same way, but I am stuck when I open the form. I can instantiate a form the same way but I have no access to .Open, and .Show etc when I do a Dim f as myForm I found that I have to open forms with DoCmd.OpenForm() that works but I can't assign values to my own properties. I've clearly missed something but I can't figure out how to word my question to the Googles. Any help?? |
#2
|
|||
|
|||
how to set form properties in vba access 2007
It's some time since I did this but you can add custom properties (which I
assume you want) as follows: Dim db As DAO.Database Dim frm As DAO.Document Dim prp As DAO.Property Set db = CurrentDb Set frm = db.Containers("Forms").Documents("YourFormName") Set prp = frm.CreateProperty(.........) See the CreateProperty method in help for details. The form doesn't have to be open to use this method. HTH "Doug Robbins - Word MVP" wrote in message ... I have cross posted this response to your question to the appropriate Access newsgroups where you will be more likely to receive the information you require. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Elijah" wrote in message ... Hello, I have to work on something in access and I am use to VB.net. In a VB winform I can have something like this Private m_Firstname As String Public Property Firstname ... End Property and when you want to set this before your form opens you just: Dim f as new frmSomeForm f.Firstname = "raz" f.Show This doesn't seem to work the same way in Access 2007. I am able to make properties basically the same way, but I am stuck when I open the form. I can instantiate a form the same way but I have no access to .Open, and .Show etc when I do a Dim f as myForm I found that I have to open forms with DoCmd.OpenForm() that works but I can't assign values to my own properties. I've clearly missed something but I can't figure out how to word my question to the Googles. Any help?? |
Thread Tools | |
Display Modes | |
|
|