General :: How To Make Form Controls Change Size / Position As Form Is Resized
Jul 24, 2013
how to make my form controls change size / position as my form is resized / loaded on a computer with a different resolution. Several of the tutorials out there suggest putting code on the "on resize" property of the form. When I looked at the Northwind database to try to mimic their code however, it looks like they must be doing something different as there is no on resize code under the form properties and I was unable to find the code they do use.
I hope I can explain this clearly. I have a subform that has a lot of information and I was wondering if there is a way to make the subform appear as if one turned up the resolution, thus making it's contents smaller, allowing me to pack more info in it. I would love to leave the size of the main form alone. I'm using Access 2000. The sub form is currently displayed as datasheet.
I have a form with a combobox, textbox, a button and a listbox.
Currently the button checks if the textbox is empty and if it is, it runs a SQL query to select data using the combobox value in the where clause, else it selects data using the textbox value in the where clause
I need to be able to type or select values in both controls and use those values in the SQL query as a where.
I am a newbie to ms access and forms and I have a small problem with a form. The solution has lots of different forms with different tabs for each section. This particular tab has a few sub forms in it. When I switch into the specific tab in question, the screen moves down ever so slightly and I always have to scroll up to see all the other tab headings.Is there a way to do something by code or a property setting I can use to make the page start from the top without users having to scroll up each time?
I hope I have explained myself clearly enough, if not I will be more than happy to provide more info.
"Microsoft Office Access can't create any more controls on this form or report.If you have deleted from this form or report in the past, you may be able to rename the form or report and then add more controls to it."
I tried: - rename the form -- > same problem - copy/paste the form --> for some reason it's not duplicating (don't know why)
I would like to open the MS Access Window in a certain position and size.
Somehow similar to open a form when using: - to set the position and size:
Private Sub Form_Load() Form.Move Left:=11500, Top:=6500, Width:=7000, Height:=6000 End Sub
I would like to open the MS Access Window within the screen area at a certain location, and having a certain size. Is there any option in the Access Menu, or I can write some code, and where has to be written, so when I double click on the *.mdb file, the MS Access Window will open where I want and the size I want.
I've Saved an Access 2010 File as an .accde version that opens Ok however none of the buttons (eg; delete record, go to first record, next record) that I placed on the form work at all (the standard record selectors at the bottom of the form still work). All the buttons work fine in the .accdb version - only the .accde version that doesnt work...
Any way to list all currently opened Access databases? It feels like this must be possible by referring to the databases collection, but I just don't know how.
Also, is it possible to refer to controls on a form in one open database from code in another database? (and obviously if so, how?)
What really is the best way, programming-wise and user experience-wise when presenting records in a form:
1) Use the form with sub-forms to show records. Add new records via a popup form and use recordsets in VBA to allow validating.
2) Use unbound controls on a form and populate with pure VBA recordsets. For data with more than one row use list boxes. A popup form used for adding new or editing etc using VBA.
3) Another I haven't thought of; new or a combination of above?
In Excel, I can dynamically add option controls to a frame on a form using the Control.Add method. Is there an Access Equivalent? I can only find Count & Item as Control. items.
It might have something to do with design view i guess.
i am working on a school database, in data base i have create two tables tblAccounts and tblTransaction and a form frmTransaction .
tblAccounts contain two fields GLcodes Description and frmTransaction contain Glcode transaction type debit credit date narratives
in form when i enter a glcode, lookup field match the code from tblaccounts and shows the description in form against gl code.But i am facing a problem when i enter a wrong gl code my form accept it and move to the next field and when i leave blank field of glcode same problem that i am facing, i want that , when i enter a wrong glcode in a form amsgbox will apear that asking for correct glcode.
I am wanting to make a text box on a form, to return a number (amount of records returned by a query)basically so if the query returns 5 records, the text box on the form will show"5",
Lets say the form is called "A", and the query is called "B" .How do I put this in the source control of the textbox ? < if this is right too ?
How do I change a txt box to a memo field on a form? (I need to allow for more than 255 chars...) I've already set the backend DB (sql server) to accept the many chars, and the linked table access see's the datatype as memo. But I can't figure out how to get a memo field on the form, or how to change the current txt box to a memo control to support the extra characters.
I've been looking for 20 minutes... I guess I never used a memo field before, since I can't find/see how to set this.
I have a Logo which is actually startup form. I need a code to position this statrup form on near to bottom right corner of access window in all resolution. How ever at present I am using code :
Res = GetScreenResolution()
If Res = "800x600" Then DoCmd.MoveSize 9600, 5600 ElseIf Res = "1024x768" Then DoCmd.MoveSize 13000, 8000 ElseIf Res = "1152x864" Then DoCmd.MoveSize 14500, 9500 ElseIf Res = "1280x720" Then DoCmd.MoveSize 16200, 7200 ElseIf Res = "1280x768" Then DoCmd.MoveSize 16200, 7800 ElseIf Res = "1280x1024" Then DoCmd.MoveSize 16200, 11400
End If
But some times user use the application on different resulotion other then mentioned in code, the position of startup form looks awkward.
I want to change column position as following order: Company, Start Month, Mar-05 , Apr-05, Fees ABC_________Mar-05____1_______2_____7 ABC_________Apr-05____________4 _____5
I tried to use this code:
Dim db As DAO.Database Dim rs As DAO.Recordset Dim qd As QueryDef
Set db = CurrentDb Set qd = db.QueryDefs("report_crosstab")
qd.fields("Fees").OrdinalPosition = 4
It doesn't work for crosstab query.
Can anybody tell me how to change the column position of the query?
I'm setting up a college database. On my enrollment form i have the following fields
Enrolment_ID Student_ID Course_ID
I'm receiving the error in my Student_ID field. It's telling me a related record is required in my Student Table.
The drop down shows the student name/date of birth/Education number
But if i set it to just show the ID it works fine, is there a work around for this as it will make life a lot easier for the dropdown to display the student names rather than the ID?
The dropdown is based on a query i have of accepted students....
I want when the form ativate to reput it in the center of the screen. is there any property to do this in the code, as the autocenter is set only in the design view
I have a .csv file where I need to parse out the information.
I have imported the .csv file into access and all the data is in [Field1]
Instead of using query design, I want to create a user interface [Form] where anyone can input in the textbox the position and length of a mid function.
Example:
Last name: Position = 1 Length =15 First Name: Position = 15 Length = 30
Is it possible for users to input the numbers in texboxes to extract the data to another table?
I'm having trouble with a Form and getting a text box entry box (Date entry) default to the date entered on the last record, which is linked to a table.
The only way I can get it to work is to type the date into the Text Box's Default property, for example, #11/13/13".
How to get the correct syntax or code into the Default property of the Text Box to make this work? I only want the entry to change versus the previous record/entry if the User changes / enters a new date.
I'm trying to ensure that each time a new record is opened in a form, that the cursor is positioned in the first control/field... I have this throughout most of my application but not in a few individual forms.
I know I've done something in the past to ensure that this happens, but I can't remember what it was...
I am having a problem with my form. When it opens up, it is maximized, which is what I want. However, the vertical scroll bar on the right does not begin at the top of the form, but towards the bottom. I have to scroll up each time so that I can see the top of my form. Is there a way to make the form startup at the top of the form?
hi i have a button that loads a report. If i then close the report the form, which is set with no border/no max/min/close/non movable and opens maximised, places itself off centre. I want it to stay maximised full screen. The only work around i currently have is when the use moves the mouse over the form it maximises itself. Will this then be calling this function everytime the mouse moves(cant be very efficient). is there a better way to maximise the form Immediately after closing the report.