OPening more than one occurrence of a form (1 Viewer)

MajP

You've got your good things, and you've got mine.
Local time
Today, 02:24
Joined
May 21, 2018
Messages
8,463
I cannot edit my posts due to some restrictions on my computer. For the query method should read ".recordsource" not ".rowsource".
 

ryetee

Registered User.
Local time
Today, 06:24
Joined
Jul 30, 2013
Messages
952
You can pass in a filter and all other properties.

dim frm as Form_SomeForm
set frm = new Form_SomeForm
with Frm
.filter = "salesid = " & me.salesidforquery
.filterOn = true
.OrderBy = SomeField
.backColor = someColor
...... whatever you want to set
end with
I want to use the .orderby property. I have a field on the query called reference number.
I've tried .orderby = ReferenceNumber (this is a field on the query and on the form as well) but this throws up an error (variable not defined).
I've tried
.orderby = "ReferenceNumber" doesn't but doesn't work.
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:24
Joined
Sep 21, 2011
Messages
14,048
So is it 'reference number' or 'ReferenceNumber' ?
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 02:24
Joined
May 21, 2018
Messages
8,463
Yes my fault, I was just trying to list some properties. My example should be
.OrderBy = "SomFieldName"
.OrderByOn = True
 

ryetee

Registered User.
Local time
Today, 06:24
Joined
Jul 30, 2013
Messages
952
Yes my fault, I was just trying to list some properties. My example should be
.OrderBy = "SomFieldName"
.OrderByOn = True

Spot on. Again!! Thanls

Where do you get all this stuff from. I can never find stuff like this from a google search.
 

ryetee

Registered User.
Local time
Today, 06:24
Joined
Jul 30, 2013
Messages
952
You can pass in a filter and all other properties.

dim frm as Form_SomeForm
set frm = new Form_SomeForm
with Frm
.filter = "salesid = " & me.salesidforquery
.filterOn = true
.OrderBy = SomeField
.backColor = someColor
...... whatever you want to set
end with

OK looks like with instances you have to 'do' things whilst setting the form up.
So I know I'm going to have a few questions on this.
One at a time...
How do I hide columns.
Conventional way doesn't seem to be working. I'm using a split form at the moment but may ditch that as it's proving troublesome.
The next question may be a biggy so I'll make sure I can't do it in the normal way first.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 02:24
Joined
May 21, 2018
Messages
8,463
So the questions that you are now asking have nothing to do with form instances. You are opening a non dialog form and you want to set certain properties. I would probably say to open a new thread, because it is about setting form properties and not dealing with multiple form instances. However, yes you can hide columns in a split form. Not really my thing, I prefer to roll my own forms so I can better control them.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 02:24
Joined
May 21, 2018
Messages
8,463
Where do you get all this stuff from. I can never find stuff like this from a google search
.
I am not very smart, but I learned how to be smarter than most people who consider themselves to be "Access Developers". I learned how to use the Object Explorer in the VBE. Using that I can find every property, event, method, and constant for an object. So for example I can type in "Form" and can find every property for a Form. Then if I see an orderyby property I will go to google and go to the MSDN (Microsoft Development Network) web pages. It will explain the details of the orderby property.
https://docs.microsoft.com/en-us/office/vba/api/access.form.orderby
If you can navigate these two things, you are on your way to be a super user / developer.
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:24
Joined
Sep 21, 2011
Messages
14,048
Search for emulated split form in this forum, might be a better option.?


OK looks like with instances you have to 'do' things whilst setting the form up.
So I know I'm going to have a few questions on this.
One at a time...
How do I hide columns.
Conventional way doesn't seem to be working. I'm using a split form at the moment but may ditch that as it's proving troublesome.
The next question may be a biggy so I'll make sure I can't do it in the normal way first.
 

ryetee

Registered User.
Local time
Today, 06:24
Joined
Jul 30, 2013
Messages
952
So the questions that you are now asking have nothing to do with form instances. You are opening a non dialog form and you want to set certain properties. I would probably say to open a new thread, because it is about setting form properties and not dealing with multiple form instances. However, yes you can hide columns in a split form. Not really my thing, I prefer to roll my own forms so I can better control them.

Decided to ditch the split form and problem disappears. The other issue I thought may raise it's ead doesn't now as it's not a split form.Thanks
 

Users who are viewing this thread

Top Bottom