General :: How To Get The Form To Open First Then Populate Grid
Sep 4, 2012
I am struggling with a slight form delay. When it opens on the OnOpen event, i am populating a grid. This takes about 3 to 5 seconds but, the it also takes the form the same time to open. What i need to do is get the form to open then populate the grid. Can i make the form open first then populate?
View Replies
ADVERTISEMENT
Aug 7, 2006
Hi all,
I'm sure this must be a well used function by many access users but I can't find anything about it online at all - please help!
I want to open a subform "AddReservation" and populate three fields with data taken from the relevant record in the main form. So in the btnOpenAddReservation_Click event to open the subform I set global variables, then in the form_open event I have this:
Private Sub Form_Open(Cancel As Integer)
Me.CatID = stLinkCatID
Me.CatName = stLinkCatName
Me.OwnerID = stLinkOwnerID
End Sub
But I get the error 2448 'Can't assign a value to this object'.
However if I put the same three lines into the start of the subform's btnARSave_Click event it works fine:
Private Sub btnARSave_Click()
On Error GoTo Err_btnARSave_Click
Dim stDocName As String
Dim stDocName2 As String
stDocName = "OwnersAndCats"
stDocName2 = "AddReservation"
Me.CatID = stLinkCatID
Me.CatName = stLinkCatName
Me.OwnerID = stLinkOwnerID
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
YesNo = MsgBox("This reservation has been added successfully, do you want to add another?", vbYesNo + vbQuestion, "Add More Reservations?")
Select Case YesNo
Case vbYes
DoCmd.GoToRecord , , acNext
Case vbNo
DoCmd.Close acForm, stDocName2
DoCmd.Close acForm, stDocName
DoCmd.OpenForm stDocName
DoCmd.GoToRecord , , acGoTo, stRecordNo
End Select
Exit_btnARSave_Click:
Exit Sub
Err_btnARSave_Click:
MsgBox Err.Description
Resume Exit_btnARSave_Click
End Sub
What am I doing wrong? Why can't I populate the fields on open?
Many thanks
PT
View 1 Replies
View Related
Jun 12, 2014
I am trying to open a form from my main form and populate fields from one to the other (then press a button).if the form is opened in dialog mode then the code won't run to populate the form (until it is closed or not visible).
The main form is showing an address, but the user can click a button to amend this. Once clicked, the Property Form is opened - I don't want the user to need to fill in all the address details again. I want this pulled through from the main form so the user can make an amendment, then save the new address.
Code:
DoCmd.OpenForm "frmPropertySearch", , , , , acDialog
With Forms!frmPropertySearch
.Form.Visible = False
If Not IsNull(Me.Building_Name) Then
strBuildingName = Me.Building_Name
.txtBuilding_Name = strBuildingName
End If
End With
View 3 Replies
View Related
Oct 16, 2012
I have a orders sub form that was working great .Then all of asudden when i when to input information into the fields i realised the grid under variuos field names has disappered (Icant enter any info),surly this must be something i have accidentally done without realizing.
View 13 Replies
View Related
Feb 16, 2013
I am writing a database to track our (and others) wine collections. i'm wanting to track what bottle is where. so i can look up what i have, look up where i have put it and away i go to get it, simple right?
just to complicate things i want a system in place. where the end user and use forms to add/remove or modify wine racks.
assuming that all racks are rectangular i would like to be able to add a rack and call it rack 1. rack 1 has 4 shelves all able to hold 5 bottles. the database would then say that bottle X is in rack 1 shelf 1 position 1.
if possible there will aslo be a screen that is auto generated by the database showing a simple grid with grrn and red squares denoting if the position if full or empty. the ability to click on a position to see what is in there or to add a bottle there would be amasing but not fussed if that can't be done.
View 2 Replies
View Related
Aug 13, 2014
I have a unbound combobox in my form. I wanna populate list value in my combobox. first value is current year. Every time populate 6 values. like as
2014-2015
2015-2016
2016-2017
2017-2018
2018-2019
2019-2020
View 1 Replies
View Related
Sep 14, 2012
Here is a project. I have a grid on a form. its width is 20cm wide and 15cm tall. in the grid are 6 groups of columns (all columns listed are from left to right).
Group 1 - 5cm wide - description
Group 2 to 6 are 30cm wide and represent days. Each group is split into 8 columns which represent hours per working day.
I need to to draw or position a line over the grid depending on what day it is and time. for example, lets say its thursday at 14.30. ( the 8 hour columns run from 8am to 4pm ) it would need to look like this-
So I need to work out the position of of the line depending on the time of of the day in the week. The day can be determined by the column header, the time by the grid....
View 6 Replies
View Related
Aug 5, 2013
Is there a way to have a date field populate automatically when a form opens but be able to change that date if need be?
View 4 Replies
View Related
Dec 18, 2014
I am in the process of (attempting) to develop a database and application for Parking & Violation Management. I have two tables at this point: "Parking Registration" and "Violations" that are linked by a "Permit #". I have developed a form that will allow the officer to enter either the "Permit" or the "Licence Plate" of a vehicle to run a "Vehicle Check" query to produce specific information for the vehicle in question; which is what I wanted, kind of... The problem is that the resulting data pops up in "table" format, and contains multiple fields, making review of the data difficult due to its lengthy, linear nature. Is there a way to have those results appear in text boxes either on a separate form or the "Vehicle Check" form itself?
View 1 Replies
View Related
May 3, 2013
basically i'll have one table, containing several fields. name/website/date.i want to create a form/s for users to use. 1 is to allow the user to create a new record. i've completed this ok
the second form is to allow users to open a form, enter/select data and run this.....and the output goes to a report.i've created the query ok.....however, when i create a form to "link" to the query open the form, it shows all my records in table i.e. i can move through the records (from bottom of form) and when i actually fill in the form it actually modifies the data in the table.
View 3 Replies
View Related
Mar 21, 2013
I'm trying to populate a field in my form from a query. I've been trying to figure it out from the web but can't get it sorted. I've got a combo box that selects a member of staff from a table, and then a query runs which takes the value from that combo to retrieve the staffs current rate of pay.
I've added this code to the on change event on the combo.
Private Sub cboStaffID_Change()
Me.txtunit.Value = [qrycurrentpay]![Unit]
End Sub
But it doesn't seem to work,
txtunit is the field I want to fill on my form, and Unit is he field name of the value I want from query qrycurrentpay.
View 2 Replies
View Related
Mar 24, 2014
I am trying to calculate the keystage and year group of pupils on my database. I have created queries that successfully calculate the data, but I cant work out how to add the results from my queries into an already created form. I thought I could use DLookup, but this just populates with a random value from the data and not the value for that particular pupil.
View 3 Replies
View Related
May 16, 2013
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?
View 2 Replies
View Related
Aug 30, 2013
I am new to access and have been staring at the same Run-time error for 3 days (pathetic I know). I cannot for the life of me figure out why it does not like my Dlookup. Esentially, I want and After Update event in my combo box to populate a Rich text textbox in my form. After reading DLookup is the easiest way to make this happen. Here is my code:
Me.emailbody.Value = DLookup("[Escalation_1]", "Status_Emails", "Status_Emails.Status =" & (cboStatus.Value))
My error reads: "Syntax error (missing operator) in query expression 'Status_Emails.Status = LOCATION NEED MORE INFO'.
LOCATION NEED MORE INFO is the value in my criteria cbostatus.value.
View 4 Replies
View Related
Oct 5, 2012
I have a listbox that is populated with data from a table. I would like to use one of the columns data as the where clause of a sql string that will populate another form, how do I get the selected items column data that I need into a variable? This is in Access 2010 vba.
View 9 Replies
View Related
Jun 21, 2013
I have modal form - frmZlecenia
I would like to copy one control, then close this form, open concrete form and pass value to control.
My code is
Private Sub Menu_Click()
DoCmd.OpenForm "frmZleceniaMarzenaNawigacjaPD"
Forms!frmZleceniaMarzenaNawigacjaPD.Form!Imie = Me.Imie
Forms!frmZleceniaMarzenaNawigacjaPD.Form!Imie.SetFocus
DoCmd.Close acForm, Me.name
End Sub
The problem is, still opens the previous form, not form "frmZlecenia"
e.g If I open form x then from this form I open my modal form "frmZlecenia" and then I will click "menu" button - now form "x" is open :/, but should be "frmZleceniaMarzenaNawigacjaPD"
There is some way to open concrete form from modal form?
View 1 Replies
View Related
Jun 30, 2014
I have three tables see below
tblplantitem
tblplantgroup
tblplantservice
so I have frm called frmplant which holds the plantgroupname I.E plant type (airblow,leads) then I have subform call plantitemtblsubform which holds the plant item serial number, value ,service date which works great now my problem I have command buttom on subformplantitemsubform then opens form call frmpopupPlantService this opens to show plantitem service history but when I add a record then save close then click the same plant item to open form frmpopupPlantService show no service history even when I just entered ...
View 5 Replies
View Related
Nov 23, 2014
how can open a report using 2 unbound textbox on a form as user input date criteria
View 2 Replies
View Related
Sep 19, 2013
I have designed a main form which have buttons for about 30 different companies name to open, each button opens an individual company form. Now the companies list is growing day by day so i want to create a combo box which select the company name and open the relevant company's form.
Do I need to create a table which lists all the companies and then add a combo box on a main screen which select the company name and open the form but i need a VBA code for that.
View 14 Replies
View Related
Jun 22, 2014
So, I've got a frmCustomer and want to link the form to frmNewWorkOrder using a button.
More precisely when I choose/scroll to a customer and click the button "New work order" to autofill data from selected client from frmCustomerto frmNewWorkOrder (First and Last name, telephone number and client ID).
View 2 Replies
View Related
Dec 11, 2012
i want to ask is there any way to open another access database using when click button at form.. for example i have tracking.accb then at my switchboard form, i would like to have a button that can go to another access which is borrow.accb. can these possible for me to do it..?
View 3 Replies
View Related
Jan 21, 2014
Can I open a tabed form to a specific page?
If I'm in the form I can move focus by using
Me.[Page 12].SetFocus
but when opening using that code produces and error Page not available?
View 3 Replies
View Related
Aug 29, 2012
When loading a form often some of the text is missing, headers are not there and/or the colours for the background are simple white, until I either resize the form or scroll up and down a few times.
View 1 Replies
View Related
Mar 5, 2015
Whenever I open the form 'TrainingF' I get the 'Enter Parameter Value' msg box. I tried to look online but could not get rid of it. I have attached the file.
View 6 Replies
View Related
Jul 17, 2013
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?)
View 2 Replies
View Related
Aug 17, 2014
I have just noticed when I open one of my forms . the database window becomes inactive and I cannot open another , form , report etc.
View 2 Replies
View Related