From: Doug Robbins - Word MVP on 22 Mar 2010 18:33 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" <raz230(a)gmail.com> wrote in message news:00383903-a182-4617-bdc6-9768e5214085(a)b7g2000yqd.googlegroups.com... > 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?? > > > > > > > > >
From: Jon Lewis on 23 Mar 2010 08:53 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" <dkr(a)REMOVECAPSmvps.org> wrote in message news:7C8726DC-D280-4AA8-ACD9-2D3F5E261A7C(a)microsoft.com... >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" <raz230(a)gmail.com> wrote in message > news:00383903-a182-4617-bdc6-9768e5214085(a)b7g2000yqd.googlegroups.com... >> 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?? >> >> >> >> >> >> >> >> >>
|
Pages: 1 Prev: How to Edit Hyperlink Next: Calculated a field in a subform. |