Modules & VBA :: DELAY FUNCTION - Opening Report
Sep 4, 2013
I am building a faux Electronic Medical Records database for the purpose of training med students. I need a command button to pull up a report , but i want to delay the opening of the report (as if waiting for "tests" to come back or be uploaded) is there a way to do this with VBA? i read about the sleep api but i dont know how to get it to work or where to put the code
so what would i add and where would i add it to delay opening the report that is called EKG W/ Subreport ...
View Replies
ADVERTISEMENT
Dec 22, 2014
I have a command button (well, I have a few) that I would like to open a report, first opening a form that allows the user to enter a start and end date.
The code so far is:
On Error Resume Next
If Err = 2501 Then Err.Clear
DoCmd.OpenForm "DateSelect", acNormal
DoCmd.OpenReport "All Events Report", acPreview
Now, when run, this code opens the form (DateSelect), but the report starts to run immediately - the On No Data event of the report kicks in (message box along the lines of "No data, closing report", so before the user has the opportunity to enter the dates, the report has decided that there is no data an closes.
Is there a way to pause the opening of the report until after the OK button is clicked on the pop up form?
Just for the sake of clarity, the pop-up form DateSelect is used to open various reports, so I can't add the open report command to the code for the OK button (that I know of?)
View 8 Replies
View Related
Jun 13, 2006
Hi Guys,
Got something which has been bugging me like mad for weeks now;
We have a MS Access Database on a Citrix server and a local copy is downloaded to the clients directory when they log on.
When they actually double click and load the database(frontend) it loads for approx 4/5mins before it eventually opens. After that it is fine, unless they log off and back on again, then the same thing happens when they double click to open the database.
The Backend is stored on a seperate server with over 5million records on it.
Before we attempted Citrix we had a normal network and the frontend has always loaded fine on this.
Any ideas?
Thanks.
View 1 Replies
View Related
May 15, 2015
I want to make delay, for example 2 minutes when the code is within the loop.
Example
Code:
For i = 0 To 100
Debug.Print i
'Before go to the next to make the delay
Next
View 12 Replies
View Related
Nov 29, 2014
When i run the following code to open my report a receive the following error..
error 3070 the microsoft access database engine does not recognise " as a valid field name or expression
Code:
strDocName = "rptBarcodingMonthly"
MsgBox strDocName
DoCmd.OpenReport strDocName, acViewPreview
The code behind the report - sets on open_report event is the following however i cant see any issues with it as i use it elsewhere..
Code:
' Create underlying recordset for report using criteria entered in
Dim intX As Integer
Dim qdf As QueryDef
Dim frm As Form
' Set database variable to current database.
Set dbsReport = CurrentDb
[code]....
I will also attach a copy of how i set the criteria in the query and the parameters
View 1 Replies
View Related
Jul 23, 2015
I am using Access 2007 & trying to update a database to include a check & balance.
Currently a user enters their name into a form, selects a check box (Pass or Fail) & clicks a save button. Real simple form. The actual testing is performed on a standalone piece of equipment separate or outside of the MS Access database.
Here is the challenge, if someone does select Fail, I want to ensure this person comes back into a blank form (new entry) & confirms they have eventually passed. I want to give a time limit of 10 minutes before an email is sent out to their superiors. (I have the email portion figured out already).
Other entries will take place before the failed user comes back to the entry form so the form needs to be available for other people to enter their results.
I believe this can be done using some VBA and a query but I am not sure where to start especially with the 10 minute allowance to recheck the test status.
View 8 Replies
View Related
Feb 12, 2014
"how to COMPACT the DB by introducing delay of 10 seconds and then close the DB".In the Database, I'm able to accomplish the "Compact" the database using the function below.
Function Compact()
SendKeys "%(FMC)", False
End Function
As my DB is quite huge, the Compact action takes around 10 seconds to complete.Now, i would like to Close the Database after Compacting the DB. I tried including "DoCmd.Quit" in the function. The commands in the function, closes the DB but the Compact function doesn't seem to have executed as it needs 10 seconds to complete.
Function Compact()
SendKeys "%(FMC)", False
DoCmd.Quit
End Function
how to introduce this delay of 10 seconds and then close the DB.
View 3 Replies
View Related
Jun 25, 2014
im working on an access report and would like a little vba script to run on when the page prints out the next record (mostly just need to hide/unhide a few objects and change the value of a variable on the report when it prints the next record)how i can trigger this (as there seems to be no onNextRecord event handler)
edit: upon a better inspection of the reports record source i realized that on next record doesnt actually work (i could force it to by adding a few new fields to queries and forcing endless loops), what i needs actually a lil more complicated
my report has a header, in the header is a field called productionNo, the record source has multiple instances of prodno's with countless duplicates, what i need is a function to trigger when the productionno changes, there will probably be a few pages with the same production number (theyd be grouped together though), so it should only trigger when the value changes, not when it stays the same
View 3 Replies
View Related
Jun 25, 2013
I'm still learning Access 2010 and having issues getting my buttons to work. I'm working on a simple address database.edit/save button. On form load, my fields are locked and my button will read "edit". After clicking, my fields are unlocked, my search features are locked, and my button reads "save" just how I need it to. The issue happens when I try and save the field edits, lock fields, return search features, and get button to read "edit" again. I know I need to add some code into what I already have, but I'm running into a wall as I have tried many options to get it to work. Here is the code for this button:
Code:
Private Function Lockdown() 'locks controls at load
Dim tb As Control
Dim cb As Control
Dim subf As Control
[code]...
Second issue is with my report button. I have not been able to get this to work once. I have done many searches on single record reports, and have found the same code every time. I added that code into my database, but can't seem to get it to work. In my database there are two address (shipping and work location) which I would like to print out together. I have the work location on the main form and the shipping on a subform. There are and upwards of 150 locations I will have in my database, Here is the code I'm working with:
Code:
Private Sub cmdrptadd_Click()
Dim strReportName As String
Dim strCriteria As String
[code]...
View 3 Replies
View Related
Dec 11, 2013
So basically I need making a function that will count the number of records from another table/query based on a field from the current query.
View 2 Replies
View Related
Apr 6, 2005
I'd appreciate it if anyone could tell me how to edit the control tip delay in form design: ie: so as the controltip comes up much sooner than the default set by access?
many thanks
View 2 Replies
View Related
May 22, 2005
I have a large Access application with several forms and modules. The form works fine and quickly. I have a combobox which queries the database containing 30,000 entries. This combobox is delayed in populating. So that if the user types into it the characters don't display for a couple of seconds. Is there anything to do to spped up the combobox? There is a join in the query so I removed it. It did not improve the delay.
Any suggestions?
Thanks
View 1 Replies
View Related
Jun 8, 2005
Is it possible to delay the Form_Current event? I use the code below to duplicate records, ask for a change in teh reference number and then resort the database according to the reference numbers. This works fine until I introduce some code into a Form_Current procedure. Now whenever I activate the macro below to copy a record the data in the copy record is wiped out and the form rendered with its defaul values. I am assuming this is because the code in the Form_Current section is rendering the form whilst something else is trying to paste values in it so is ther a way to delay either the pasting of the new data or the activation of the Form_Current procedure?
I have tried using a few basic counters but to no avail! Any help would be greatly appreciatted.
Cheers
_______________________________
Private Sub cmdCopyPrevRec_Click()
On Error GoTo Err_cmdCopyPrevRec_Click
Dim TestNum As String
TestNum = Test_Number
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70
NewTestNum = InputBox("Please enter test number:", "Test Number", TestNum + ".1")
Test_Number = NewTestNum
Test_Number.SetFocus
DoCmd.RunCommand acCmdSortAscending
DoCmd.FindRecord NewTestNum, , , , , acCurrent, True
Exit_cmdCopyPrevRec_Click:
Exit Sub
Err_cmdCopyPrevRec_Click:
Display = MsgBox("Copied without updating Test Number", vbOKOnly)
Resume Exit_cmdCopyPrevRec_Click
End Sub
View 1 Replies
View Related
Aug 1, 2007
Is there any function to delay the system processing for a number of seconds.
For the time being I am do it indirectly by using loops, however, it is un proper way, as it is not scalable.
Also I dont want to use the timer control.
Thanks,
View 4 Replies
View Related
Sep 30, 2005
I have some code that is running in a FOR NEXT loop. I am calling another form each pass of the loop. For some reason the form does not fully come up, the box and header text come up but nothing inside the Form.... Any thoughts.....
At the end I want to display another Form that confirms the updates/calculations. But I want the Form to close after say 2-3 seconds. I tried a wait function but that does not allow the form to fully open as above....the wait function is waiting for the time i want but it again does not allow the form to open....it waits and then the form closes, never showing what is in the form?
Does anyone know how I could open a form display some information and then have it automatically close after a few seconds.
I call the Function TIMEDELAY below which is calling the Function Wait....Once in TIMEDELAY it opens the form and then supposed to wait then close....but the form never fully opens? .....
View 1 Replies
View Related
Aug 16, 2007
is this right?
Code:DoCmd.OpenReport "3rd Party Denial, Report, , [Claims Header].[Claim_ID]=[Forms]![claiminformation]![ReportForm]![Report_ClaimID], Normal"
I get an error stating you entered in either the property sheet or macro is misspelled or refers to a report that doesn't exist.
View 4 Replies
View Related
Dec 16, 2013
When moving to a new a record in my form, i will click on a text box and the following happens:The black line will flash much faster than normal (This will happen on any text box i click on) No text will appear while this is happening When it stops al the text that was typed in that period will appear After this 5 to 10 second text delay the text box and all other textboxes will work fine, until i move to a new record and the process starts again
View 2 Replies
View Related
Sep 2, 2005
Hey there, if anyone could help me with the code for opening a report please. I have a main page with buttons, and need a button for opening reports.. thx
View 1 Replies
View Related
Aug 16, 2006
Is it possible to open a report using a combo box. At the moment all my reports are opened using cmd buttons. This is just a question of curiosity, I will continue to look into it myself of course.
View 8 Replies
View Related
Jan 18, 2013
I have a form in Datasheet view and when you click on a record in that form I want it to take you to a report with all the details of that record number. I have the On Click event set to run a Macro. The Macro is as follows:
OpenReport
Report Name Incident Report
View Report
Filter Name Open
Where Condition =[Event ID]=[Reports]!Incident Report]![Event ID]
Window Mode Normal
This Where Condition works for me open another form from the form with the same Event ID. Why does it come to a "new" Incident on the report?
View 1 Replies
View Related
Mar 21, 2006
Is there any way to put a shortcut on someone's desktop that will open a specific report in an Access database? I'm thinking back to the days of DOS when one simply added an argument to the command. I don't want to put it in startup and have it always go to that report. I just want non-Access users to go right where they need to without menus, etc.
:confused:
Thank you.
View 2 Replies
View Related
Feb 28, 2006
I want to create a report using the data currently held in a form. I found this bit of code somewhere:
DoCmd.OpenReport "report", acViewPreview, , "[job number] = " & txtFilter.Value
txtFilter is the name of textbox containing the data I want for the report. This works if in the table for txtFilter's data the field is set to a number. But if I set this field to text it comes up with a data type mismatch error. How do I solve this? (sorry new to access and vba). The reason I want to set it as a text field is so that I can limit the number of characters entered.
Thanks
Chris
View 1 Replies
View Related
Mar 19, 2006
Im sorry about the stupid questions!
How can I open a report in a view which will let me test my buttons? I only seem to be able to open it in print preview!
View 4 Replies
View Related
Nov 3, 2004
I have looked through the threads and have not found an answer to my question, so I post it hoping there is an answer as well as documenting useful information for other individuals.
The following code is what I am using to 'pull' data in order to print a certificate. It functions the way I designed it (verified by debug.prints and msgboxes). My question is how do I pass data to a defined report (certificate) based upon the results of a built recordset. When the report opens, the values come up as "#Name?". I'm guessing that the issue is syntax, but I just don't know. Here is the code I have so far (I've even commented it for y'all)...
Looking forward to your comments...
-BT.
Dim RSAgg As Recordset
Dim RSsrc As Recordset
Dim DB As Database
Dim strAgg As String
Dim strSQL As String
Dim strCert As String
'If there is no week number set, drop out
If Not IsNumeric(txtWeekNum) Then
MsgBox "You Must Specify a Week Number.", vbInformation + vbOKOnly, "Required Input"
Exit Sub
End If
' tblAggDesc contains the field names
' that have scores I want to evaluate.
' If someone makes a perfect score,
' then they get a certificate. Fields are
' a1, a2, a3, b1, b2, b3, c1, c2, c3.
strAgg = "SELECT tblAggDesc.AggCourse, tblAggDesc.AggDesc FROM tblAggDesc;"
Set DB = CurrentDb()
Set RSAgg = DB.OpenRecordset(strAgg)
RSAgg.MoveFirst
Do While Not RSAgg.EOF
If (Right(RSAgg!AggCourse, 1) > 1) Then 'rounds 2 & 3 contain additional information that is printed on certificate
strSQL = "SELECT tblScores.HEDR, tblRoster.Fname, tblRoster.Lname, tblScores.WeekNo, tblScores." & RSAgg!AggCourse & ", tblScores." & RSAgg!AggCourse & "X AS AggCourseX " & _
"FROM tblRoster LEFT JOIN tblScores ON tblRoster.HEDR = tblScores.HEDR " & _
"WHERE (((tblScores.WeekNo)=" & [txtWeekNum] & ") AND ((tblScores." & RSAgg!AggCourse & ")=100));"
Else
strSQL = "SELECT tblScores.HEDR, tblRoster.Fname, tblRoster.Lname, tblScores.WeekNo, tblScores." & RSAgg!AggCourse & " " & _
"FROM tblRoster LEFT JOIN tblScores ON tblRoster.HEDR = tblScores.HEDR " & _
"WHERE (((tblScores.WeekNo)=" & [txtWeekNum] & ") AND ((tblScores." & RSAgg!AggCourse & ")=100));"
End If
Set RSsrc = DB.OpenRecordset(strSQL, dbOpenDynaset)
If Not (RSsrc.BOF And RSsrc.EOF) Then
RSsrc.MoveFirst
Do While Not RSsrc.EOF
If (Right(RSAgg!AggCourse, 1) > 1) Then
strScore = RSsrc!AggCourseX & "X"
Else
strScore = ""
End If
'MsgBox RSsrc!Fname & " " & RSsrc!Lname & " " & RSsrc!WeekNo & " " & RSAgg!AggCourse & " " & strScore & " " & RSAgg!AggDesc
strCert = "Fname='" & RSsrc!Fname & "' AND Lname='" & RSsrc!Lname & "'" & " AND WeekNo='" & RSsrc!WeekNo & "' AND XCount='" & strScore & "' AND AggDesc='" & RSAgg!AggDesc & "'"
'Debug.Print strCert
' this is the point that I have problems.
' I want to pass RSsrc!Fname,
' RSsrc!Lname, RSsrc!WeekNo,
' RSsrc!AggCourseX, RSAgg!AggDesc to
' the report.
DoCmd.OpenReport "rptCleanTarget", acViewPreview, , strCert
RSsrc.MoveNext
Loop
End If
RSsrc.Close
RSAgg.MoveNext
Loop
RSAgg.Close
Set DB = Nothing
View 6 Replies
View Related
Dec 7, 2005
How do I get a query to run upon opening a report. My report has a few fields from a query that once the user inputs information the query is obviously outdated. Since it needs to be as simplistic and user friendly as possible I won't ever have them run the queries themselves so I'm trying to have them run to be updated for the report when the user goes to open the report.
View 1 Replies
View Related
Feb 25, 2013
I have two pop up forms called "frmRepair" and "frmPaid" with a button that opens another popup form called "frmLabels". This final form has a button to print a report with the following code:
Code:
DoCmd.OpenReport "rptlblCombined", acViewPreview, , "CallID=" & Me.CallID
The problem is that when this report opens, it is always behind frmRepair or frmpaid and frmLabels so it can't be seen.
I tried to use the popup and modal properties on the report, but this does not seem to do what I need.
My next step was to hide frmRepair or frmPaid when frmLabels loaded and then hide frmLabels when I was printing the report, but the problem is that when the report closes I need to also close frmLabels (easy) but then I need to make visible either frmRepair or frmPaid, depending on which one was used to open frmLabels. How can I do that? How do I know which one of the two forms opened frmLabels to make it visible again?
What are my options to have that report open on top of everything?
View 1 Replies
View Related