Changing Subform Size
Jul 26, 2005
A quick design question here,
Is there any code that you can add so that you have your main form open to maximise and your subform adjusts accordingly ?
My database is used by a number of users, some use 1024x768 and some use 1280x1024. I want the main form to maximise when loaded but I would also like to get the subform to adjust its size accordingly (avoid a thicker border around the edge of the main form)
Alternativey, is there a way to get the DB to detect what the screen settings are and have an IF statement when loading the form ?
Many thanks
MattP
View Replies
ADVERTISEMENT
Dec 11, 2007
I've asked this question in different forums before, and though some people say it can be done, I have not found anyone who is successful yet.
I have a report that puts down a person's address, however the address information is stored within the database in separate fields ('Address', 'City', 'State', 'ZIP'). The issue I have is with the City/State/ZIP. Some city names are longer than others, is it possible to have the fields adapt to the different word lengths.
Say the address is, Albany, NY 10023. The database would output this alright, but then if the city name is San Francisco, CA 94143, the fields are in disarray.
I have the same issue with names. Last name and first name are stored separately. I would like to display Last, First. My workaround has been to right-align the Last name, and put it adjacent to the left-aligned first name field. This works unless the person's last name is very long, disporportionately from the first name, in which case, it looks very much off center in the overall report.
Any help would be appreciated.
View 5 Replies
View Related
Oct 13, 2005
Hello this is my first post in the definetely best Access & VBA forum on the net and i hope i am in the correct forum to ask this.
I would like to know if there is any way in access to change the size of the for my users view according to their screen's resolution.
E.g. i am creting the form using 1280 x 1024 resolution and my users have 1024 x 768 resolution how go i make the form adapt to their res.
Thanks for any replies :D
View 3 Replies
View Related
Aug 16, 2015
I created a report from a query and there is many fields therefore it made the report 22" wide. I rearranged the fields with in 8" but in the property field when I put 8 in there it does not change and it goes right back to 22". in print preview there are 6 pages and only 3 with info showing the other 3 are the extra width of the report.
View 1 Replies
View Related
Jul 28, 2014
I have a report that prints labels (similar to avery labels) which pulls data from a query. These labels are all unique and vary in length. Due to the length variance, I want the font size to get smaller for labels with more characters. I want the text to go down to another line when necessary.
In my report under the OnPage Event Procedure I wrote this:
Private Sub Report_Page()
If Len(Text2) > 20 Then Text2.FontSize = 8
If Len(Text2) > 10 And Len(Text2) < 21 Then Text2.FontSize = 10
If Len(Text2) < 11 Then Text2.FontSize = 14
End Sub
This works to some degree but the problem is that once there is a longer label, all of the proceeding labels are resized & the longer label that should have been resized was not.
Is there another place I should be writing this code? I looked under events for the textbox but there doesn't seem to be anything that would work since none of them would trigger when printing labels
View 3 Replies
View Related
Sep 16, 2014
I have a form, a couple of comboboxes and text boxes on it. When these are filled out, the SQL of a query is changed using these parameters.
There are three subforms on the form, all pivot charts, all based on the query being changed.
The goal would be to update all three according to the user-given parameters.
Right now the subforms only update if I close and open the form, which is probably not the best solution, since it's too slow.
I've also tried to requery and refresh them, with no result.
Then I tried to overwrite the recordsource of the subforms with the same text that was originally there. This got them to refresh their data, but then all of the charts disappeared and had to be built again, so this is a no go too.
View 7 Replies
View Related
Apr 4, 2005
well, I have managed to get everything to work. Its a great feeling. the only thing I am having trouble with now is cosmetic.
http://www.lanschoolyard.com/newwindow.jpg
http://www.lanschoolyard.com/bar.bmp
Notice how the size of the text is a lot bigger than the size of the same text in the first image?
How do I reduce the size of the text? I have looked in all the boxes and tried everything but it just doesnt want to change the final output text size.
View 1 Replies
View Related
Nov 16, 2007
I have a subform on my main order form. I would like to click a button on my main order form and have it change a control on the subform. For instance, I have 2 controls on my subform, control 1 is a text field, and control 2 is a yes/no box.
When i click the button on my main for order form, I would like it to evaluate control 1 on my subform so that it can adjust control 2.
I would like to see if control 1 is null then set control 2 to yes or true. Thank you in advance for all your help.
View 4 Replies
View Related
Feb 8, 2005
I have a Cmd button set to
=[TblAddress Subform].Visible=Yes
in the event of onclick - and my subform properties are set to visible = no.
However this does not have the desired effect - rather than make the subform appear - it does nothing.
I'm guessing there may be an error in the exression syntax, but I don't recieve any error messages.
Can anyone spot the error?
Many Thanks,
Andy.
P.S. how can I put two commands into one expression, how do I seperate the two orders?
View 8 Replies
View Related
Jun 1, 2005
I am working on a database with two main tables: One table that is linked in from another database, and another table contains addresses to the location of jpegs that correspond with the records in the linked table. (Every record does not have corresponding jpeg, only some of them do.) The way the forms are currently set up, there is a main form and a subform. The main form contains only a combo box where the user can choose a record. The subform shows the rest of the information pertaining to the record, including the jpeg. The problem is that all the other information changes when the user chooses a different record - except for the jpeg, it stays the same. The code to pull the jpeg into the form works when under the form load procedure, but the jpegs do not change when a different record is selected from the combo box on the form. I tried to do this a straight forward way, and then I tried using the RaiseEvent command, but nothing seems to work. I have a relationship b/t the 2 connecting fields, and I have tried all 3 join types. Any help would be greatly appreciated.
View 2 Replies
View Related
Mar 25, 2005
Hello, I have a form with a subform. I want to change the record source on the subform during an OnClick event. I am not sure what I'm doing wrong, but I get a "object does not support this method" error. Can anyone help? Thanks in advance.
View 1 Replies
View Related
Apr 18, 2005
Weird yet aggravating problem.
I am trying to setup a routine that will allow the user to change the RecordSource of a subform. The RecordSource is being changed yet once I move to another record the subform is reverting back to the original subform RecordSource. I am using the below command to change the subforms RecordSource...
Me.MySubformName.Form.RecordSource = MySQL
I even to make a copy of the subform and I changed the table it is linked to yet I got the same result
Me.MySubformName.SourceObject = "MyOtherSubForm"
There are no functions in the record selectors that would interfere with the subforms RecordSource.
Any suggestions as to why the RecordSource of my subform will not "stick" when I move to another record?
Thanks in advance for your help!
View 8 Replies
View Related
Jun 29, 2005
Hi
I have problems working with a 3 level form
I have one main form called Projects
Depending on the record on the form Projects, the subform called Products will display the correct info
And on the OnCurrent event of the form Products, it will display the correct info for another subform called Product_Info
The problem is, the subform called Product_Info is dependant on a field on the Projects form, and on a field on the Products form so I cannot directly link the Product_Info form with either the Projects of Products form
What I'm doing is changing the recordsource of the Product_Info subform on the OnCurrent event of the Products subform but for some reason it won't work
If I display the recordsource of the Product_Info subform, it displays the right recordsource triggered on the OnCurrent event of the Products subform, but the data doesn't display
Thanks
View 3 Replies
View Related
Jan 13, 2005
Hi,
I have a form that has a query on it. It acts as a subform. I would like for this query to be able to switch depending on what employee I've got selected on the form. I've tried playing around with the sourceobject property:
Dim name As Variant
name = Forms![Time Input Form]!Employee
Forms![Time Input Form]!Table.SourceObject = name
, but it keeps telling me
"Run-time error '3011':
The Microsoft Jet database engine could not find the object
~sq_cTime Input Form~sq_cTable'. Make sure the object exists and that you spell its name and the path name correctly."
The names directing to the subform are absolutely correct though. I'm just not sure if this is the right property to use.
Anyone have any ideas? Thanks. =)
View 1 Replies
View Related
Feb 27, 2006
Hi everyone. I need help on this one
I have a form with a subform. The subform is basically the sale history of the item on the main form (The main form shows a record and then the subform reports its history). This all works fantastic, except that on the subform, every time a new record is entered, it goes to the bottom of the previous one, so after a while, if I want to enter more history into the subform, I have to scroll down through all the older ones to get to the more recent ones.
How can I do it so that in the subform the most recent entry is always at the top and each time a new record is entered, the older ones move down one. This way the most recent records are always on display and older ones move down as they become less important. Likewise, the empty record used to enter data is also at the top!
Thanks!!
View 14 Replies
View Related
Nov 2, 2014
Can I change the Records Source of a subform from within that subform and do a requery to have a different set of records displayed'
I want to be able to refine the records displayed in the subform
View 8 Replies
View Related
Aug 29, 2005
Will keeping your field size shorter result in a smaller MDB file?
Or does Access only use as much space as there is real data in its fields.
Way back in the dBASE III days, dBASE would pad all your "real" information with as many spaces as necessary to fill up your field. I suspect that the MDB structure is probably smarter than that.
Another question on the same topic - I believe there is a maximum number of characters in a record (4000?). Can your field sizes add up to more than 4000, as long as the actual data, all combined, never totals 4000...?
Thanks............
..dc
View 3 Replies
View Related
Aug 30, 2005
I'm trying to change a database that consists of a sequence of subforms held individually within different tabs on a subform. There seems to be a bit too much going on, so I've decided to leave the subforms unbound, and set them when the appropriate tab is selected, and unset them when the tab is changed. For most of the subforms, this works fine...
However! There's always an exception!!!
On one of them, when I set the sourceobject, it automatically populates the linkchildfields and linkmasterfields properties with an inexplicably crazy number of fields, most of which aren't even on the forms in question. I've tried to get around this by setting linkchildfields and linkmasterfields after changing the sourceobject. This does not work!
The first thing that happens is it returns error 2335 (relating to an imbalance between the number of fields) when I set linkchildfields. I try to get around this by trapping and resuming to the next step so it sets linkmasterfields and restores the balance, but, despite the fact that the linkchildfields and linkmasterfields are showing the correct fields, the form acts as if it has been bound with the screwy list of fields, and starts asking for fieldnames which are on neither form as parameters. When I hit cancel the subform control is empty.
I'm at a loss as to what the problem is or how I should sort it out! Any suggestions gratefully received.
View 2 Replies
View Related
Dec 27, 2013
I have a form containing client demographics. One of the fields is the DateOfBirth. I would like to control the visibility of a subform based on this DateOfBirth field.
I have tried using the code below:
Private Sub Form_Current()
If DateOfBirth > 11 / 11 / 1994 Then subEligibility.Visible = False
End Sub
This works when the form is opened for the first record, but the visibility does not change as I scroll through the rest of the records.
View 4 Replies
View Related
Aug 8, 2014
I have a table of events, tblActivitiesDates which have an activity type and a date.I have a form which has a datasheet with a query source (a separate datasheet form embedded in this one), and 2 radio buttons. The query that is used uses radio buttons this way:
-Activity Type Filter: A radio button, that when clicked a combo box appears, with a list of activity types to choose from. Basically, filtering by Activity Type.
-Date Type Filter: A radio button, that when clicked 2 text boxes appear, in which you write the dates between which you want to see the events organized in the table. Basically filtering by dates.
To make reading easier, Activity Type Filter=ATF, Data Type Filter=DTF.There are 4 possible options:
-ATF=ON and DTF=ON
-ATF=ON and DTF=OFF
-ATF=OFF and DTF=ON
-ATF=OFF and DTF=OFF.
For each option, I have written a line of code in the appropriate OnChange/AfterUpdate/Whatnot events in the form: CurrentDb. QueryDef ("qry ActivitiesDates"). SQL = "SELECT..."according to whatever option is currently active.
When I enter values into the form, and instead of embedding my datasheet form I simply open it every time from the navigation pane in a new window, the datasheet is filled appropriately and works 100%. Of course, I have to reopen it every time I change something so the query will rerun.After the table crashes (will be explained soon), I re-embed it to the form before trying it again. The first time I re-embed, no matter what I do, the query doesn't update nor crash.
Say I start with the option ATF=ON, DTF=OFF, it will work fine, updating when needed, but if I tick DTF=ON, regardless of the dates I enter, the table will only change according to the first option (While when open in a new window will show the correct table entries), ignoring the fact that the QueryDef. Sql has changed. Once I tick ATF=OFF, the table crashes and I get the error:"Run-time error'3420': Object invalid or no longer set".The exact same thing happens when I go DTF=ON,ATF=OFF. It ignores the event types I enter, and once I tick DTF=OFF, it crashes with the exact same error.
I added Me.Activities_DS.Form.Requery (datasheet's name is Activities_DS) in every place it should update.
View 8 Replies
View Related
Aug 22, 2006
i have a subform on a form with Source Object="Query.myquery", my form is generating a sql string dynamically and assigning this sql string to the RecordSource property which works fine. But now if the user changes the width of the columns in the subform and close the form , a prompt is thrown asking if the "myquery" needs to be saved. I dont want to save the settings of "myquery" but at the same time avoid this modal dialog. If i use DoCmd.SetWarnings=False , i dont see the warning anymore BUT the query gets saved.
I am using "myquery" to just display column names in the subform when the forms loads and also without it i cant directly use RecordSource property in my code.
any suggestions?
View 1 Replies
View Related
Sep 18, 2006
Hi,
What should be done when the size of a database keeps getting bigger and bigger?
Regards,
B
View 14 Replies
View Related
May 10, 2007
I'm trying to create an mdb that is well over 2 gig and everytime it gets to 2 gig, I get an Invalid argument statement. Is there any way to bypass this process and create an mdb in excess of 2 gig? I've tried linking tables, queries, etc and I have also compacted and this mdb is simply that big.
View 14 Replies
View Related
May 20, 2005
I'm still in design phase but I'm going to have more than 30 tables. I know I'm going to have a pretty good number of forms, queries and reports. Should I start preparing for the worst in case this db gets too big? What kind of techiques can I use to make sure that it still runs quickly enough?
Thanks
scratch
View 4 Replies
View Related
Jun 9, 2005
I have a query that consists of three fields. This query is then placed in a form. I would like to set the physical length of my fields because one field consists of 4 digit numbers (I want the size of this to be relatively small) and the other two field consist of categories (field that need more space so that the user may see each letter of the category) Please help.
View 1 Replies
View Related
Jun 14, 2005
In the time-honoured fashion of reducing the size of the front end of a db I imported everything into a new db. The size reduced from 32mb to 17mb. Success.
When I change anything, no matter how small, in the new db, it immediately increases in size back to 32mb. I always compact on exit.
This is annoying, rather than a major problem.
Am I doing something wrong or is this a “feature” of Access?
Access 2000 on XP professional.
View 2 Replies
View Related