Data Access Page Onload Event Problem
Aug 8, 2006
This behavior is driving me crazy!
I have a data access page with an onload event for the window. All I want to do is go to a new record, update a date field with today's date and save the record. Here is the code:
<SCRIPT language=vbscript event=onload for=window>
<!--
window.MSODSC.CurrentSection.DataPage.NewRecord
request_date.value=DateValue(Now)
MSODSC.DataPages(0).Save()
-->
</SCRIPT>
When I load the page, I can see the date pop into the request_date field, but then it disappears. I made sure the value update code works by putting it on a different object's click event. The problem is when it's in the onload event for the window.
Is there something I'm missing about this event that prevents this from working? Thanks!
View Replies
ADVERTISEMENT
Aug 10, 2006
Okay, me again, on my DAP (Data Access Page) I have a piece of JavaScript that tells my page onload compare 2 dates. It's straight forward and all and my code works. That's actually where the problem is... When access loads my DAP up it builds the page, executes the javascript and THEN populates my fields with all the records. So my comparison javascript will always execute BEFORE the data loads into my DAP...
<body language=”javascript” onload=”colorBox();”>
<SCRIPT LANGUAGE=”javascript”>
Function colorBox(){
If (Quarter1DueDateP1 >= Quarter1CompleteddateP1){
Box3.{background-color:Green;}
}
Elseif (Quarter1CompleteddateP1>=Quarter1DueDateP1){
Box3.{background-color:Red;}
}
Else {
Box3.{background-color:Yellow;}
}
}
View 1 Replies
View Related
Nov 17, 2014
I am dynamically trying to set a control default value. I have the code below in the On Load event of the form. I get an error msg that says "Run-time error '2467': The expression you entered refers to an object that is closed or doesn't exist."
Forms(mainform)("Dyn_" & Trim(str(Project_ID)) & "_SubFrmTab03" & PT_Suffix & "_Approval").Controls("Groupid").DefaultValue = "=Forms!" & mainform & ".ClaimInfoGroupID"
View 3 Replies
View Related
Aug 16, 2015
I have a form with an onload event that apparently only runs when it wants to. I've checked the onload property on the form and it is set to event procedure. Went through the code on the event and everything looks good. When i mark it in break mode and step through it it runs fine. When I take the marks off it sometimes works and sometimes doesn't.
View 6 Replies
View Related
May 26, 2015
The image below describes the scope of the issue.
The function is called upon in the onLoad event of frmMain.
View 3 Replies
View Related
Sep 26, 2014
I currently use code in a module and code on each form in the on_load event to change the icon of the form.. the code i use is as follows..
in a module:
Code:
Private Declare PtrSafe Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Private Const WM_SETICON = &H80
Private Const IMAGE_ICON = 1
Private Const LR_LOADFROMFILE = &H10
Private Const SM_CXSMICON As Long = 49
Private Const SM_CYSMICON As Long = 50
[Code] ....
And on each form on load:
Code:
SetFormIcon Me.hWnd, "k: est directoryhsicon.ico"
What I am wondering is would it be possible to store the .ico file within the DB file itself (i know access can store bitmaps) and reference the .ico in the form load event code?
Overtime the db file will probably move to its own dedicated storage so using a direct reference to the file wont work..
I have tried the following but get an error (it tries to reference the .ico file as to being in the root directory of the db file)
Code:
SetFormIcon Me.hWnd, Left(CurrentDb.Name, Len(CurrentDb.Name) - Len(Dir(CurrentDb.Name))) & "hsicon.ico"
View 2 Replies
View Related
Apr 15, 2013
I have some code on a button that opens a form and changes the caption of a label:
Code:
DoCmd.OpenForm "frmRepair", , , , , , "CancelNo"
Forms![frmRepair].Form.[lblmain].Caption = "Missing Parts"
This code works well and frmRepair opens with the updated label caption. The original value was "Return/repair Information"
A few other things need to change on frmRepair depending on this caption as well as the values of some other fields, so I use the following code in the onload event (although I later tried the onopen even)
Code:
'Disable labels button if there is no RMA and the item is a repair
MsgBox Me.lblmain.Caption
If Me.lblmain.Caption = "Return/Repair Information" Then
Me.txtRMA.SetFocus
MsgBox Me.txtRMA.Text
[Code] ....
However, I cannot get this to work as the "if" statement always returns "Return/Repair information" and not the modified caption. The message box confirms that this is the case.
I suspect that this has to do with the point in time that the frmRepair loads or opens and when my code enters the modified values.
View 13 Replies
View Related
Dec 30, 2007
Hi All,
I have a data access page needs a filter by a dropdownlist, the dropdownlist used is a html control and I use javascript to filter the data programmaticlly in the onchanged event of the control.
MSODSC.DataPages(0).Recordset.Filter="AppID = 3";
My problem is, when this statement runs, the page refreshes. But I don't need the page refreshes, it set the dropdownlist text to the default text, not the value user select. The browser is IE7.
How can I stop the page refresh itself?
Thanks and Happy New Year!!
View 1 Replies
View Related
Dec 10, 2012
I have a Form with 2 subforms. One subform has an onload property to adjust columnwidths. I am trying to do the same for the other subform - but I get the following error:
The Expression on load you entered as the event property setting produced the following error: A problem occurred while micorosft office access was communicating with the OLE server or Active X Control.
View 3 Replies
View Related
Oct 2, 2005
Is it good to use (to make) Data Access Page to access the database (and put it on the web ) ?? :confused:
View 1 Replies
View Related
Oct 19, 2005
I have a photo (jpg format) which store OLE field in a table. But, I would like to display it in a Data Access Page. But, I have being prompt the following error: "You tried to drop an OLE or long binary column onto your data access page. There is no HTML control which binds correctly to this column type."
Do anyone know how to overcome this problem?
View 1 Replies
View Related
Apr 12, 2006
Hi,
Can anyone tell me how I can get my data input web page to load with a new fresh input page. At present, each time a user opens the form, it displays the last record that was input previously.
When using a form, the record properties can be changed so that when the form is opened, it displays a new blank record to fill in. I cannot find any properties in the web page design view that allow it to be set to startup with a new blank page rather than the last record that was entered.
Any suggestion?
Thanks
View 1 Replies
View Related
Jul 31, 2006
Hi,
So i have made a Data Access page using the wizard from a table called Employees
I want the Access page to have some sort of search button so that they can quickly find an employee, rather than scrolling through all 100 records.
How can i do this?
Thanks Brian
View 2 Replies
View Related
Jan 15, 2007
Hey guys,
I'm somewhat new to MS Access. I'm trying to allow a user to update, add/delete records through a data access page. I am able to view the query, navigate through the results, but I am not able to make any changes. I get a pop up message saying the record set I am using is read-only. As far as I know, my table is fully editable. Anyone have input on this issue?
View 5 Replies
View Related
Sep 1, 2007
Hi All,
I have created a Data Access(DAP) Page to append the sales order received on phone. The Data Access Page is linked to query which has autonumber field to store the Sales Order. I have a textbox on DAP for Sales Order No. The autonumber generated in Table is different from autonumber generated on DAP. I want same the autonumber on page and in table.
Thanks for time.
S Acharya
View 3 Replies
View Related
Oct 3, 2007
Hello Everyone,
Can you allow the users to update and edit the data access page and actually change the data in the database? Or is it just a view only? If possible I need the user to be able to update the database through the data access page.
Is this possible?
Any ideas would be helpful.....
Thanks
View 1 Replies
View Related
Dec 21, 2007
I have a database for my staff to enter data into via a data access page. It works on all windows xp os computers. We do have staff working on Windows 2000 os computers and it is not working appropriately.
The database was created in Access 2003. When the user pulls up the page, none of the drop down menu's populate. I try to trouble shoot it and access states that it can't make a connection to the database. This is only on Windows 2000 os. Windows XP computers work fine.
Any suggestions?
Thanks in advance,
jason
View 1 Replies
View Related
Dec 29, 2004
I have built a BD with several date fields (on a form) that were set up with a simple command button for "today's date" to be entered.
I'm attempting to set up a Data Access Page that is very similar and easy to use. I need help setting up command buttons that auto-populate text boxes.....if this isn't the best route, I'm open for ideas.
I have just started putting the Access Data Pages together and don’t have a real good grasp yet.
Any help would be great…..
View 1 Replies
View Related
Oct 26, 2005
I have a database that I'm trying to create a data access page for. The database allows people to put in their information and register for a conference. This part works fine.
I tried using the data access page wizard to create the page. I can't seem to get the connection string to point to the database so that when I upload both to my FTP, they will work together.
I have successfully uploaded the access pages to the FTP, but it will only update the database if it remains on my computer.
How can I set the location to be relative to the data access page? (eg - DB1.mdb is on ftp in /_private, data access page in same directory on ftp and looks in its own directory).
Or, maybe the problem isn't this straight forward?
Thanks,
--Jim
View 1 Replies
View Related
May 5, 2006
I use data access pages for manipulating data from DB.
I wish to retrieve data from my Access2003 database using an SQL variable value which should be entered through some text box.
I would like to make DAP that would have one text field and action button, returning a result based upon my entry in that text field.So when button pressed
Can someone give me some sample ASP or VB code for doing this?
View 2 Replies
View Related
Mar 18, 2013
I have created a very simple Data access page and saved in in a folder on my computer, I can open it from MSACCESS. But when I try to opent it directly from where it is saved here is what happens:
- The explored message as the content is not allowed by secutity settings. then I allow the content.
-I got a message that Windows will close this program (Internet Explorer) to protect your computer.
View 1 Replies
View Related
Jun 22, 2005
I'm currently using a data access page web form in order for users to enter data into my database. The database is protected with a generic password. Whenever the form is opened in IE, it asks for that password.
The functionality that I want is for the users accessing the database through the data access web form to not need a password, but I do want the password on the database itself. This way users can't just see all the information stored within the database, but they can submit certain information through forms. Is this possible? I can't really find much about data access pages even requiring passwords, but it makes sense. I just don't know how to achieve the desired functionality.
View 3 Replies
View Related
Aug 19, 2005
I created a hyperlink that links to a zip file. But when I use IE to browse the page, I cannot see "save target as" after right clicking the hyperlink. Why? Thank you very much for any help.
View 1 Replies
View Related
Aug 8, 2006
I am trying to make a DAP for data input into a table.
I used the wizard and it has the fields I want, I can scroll through them and view the entries, but they are not editable.
I read about changing the Page DataEntry property to True, but I still cannot select any of the editboxes on the DAP and now the DAP just shows blank non-selectable editboxes.
I decided to create a dummy table to work with to test creating a DAP, my dummy table looks like this:
Group Name Number Text
1 Bill 3 pink
1 Adam 5 green
2 Charlie 7 blue
I ran the wizard on the above table and again I can scroll through but not select any of the fields, and with DataEntry set to True I still cannot select/edit the textboxes.
Is there something else I need to do to be able to make an input form?
Once I get that sorted out I have a followup question: The dummy table above is where the input data goes, but on the input form I would like if possible to get the Group and Name from a different table using drop-lists. The real table has over 5000 names split into groups of about 30-50 so picking a group first would help find a name in the list which will eventually be input to the table above.
Hope that all makes sense, and thanks in advance for any help!
View 1 Replies
View Related
Mar 19, 2007
Hello
Can anyone help?
Im in the process of making an access database with a login form. I used VB code to validate the login which was bound to a logon button after the user puts in a username and password.
This worked fine - but I now need to do the same for a data access page.
Can anyone tell me how to do this please?
Many Thanks
Daz
View 6 Replies
View Related
May 4, 2006
Hi all,
I was thinking if some could suggest me how could I make DAP which will have only one text box and command button in which will the value written there be forwarded to some parameter SQL when that button is pressed...
Do you know what VB code should I implement in onClick action for that button so he could start some query who would use value placed in that text box and then generate results in DAP....
Any comment is appriciated!:rolleyes:
View 3 Replies
View Related