I am using the VB KeyDown event on a text box. I am wanting to use keys F1 - F8.
The intended code runs for each key (using a case statement), but also the windows default task runs for that key i.e F1 will load help and run the code in the key press event.
Any ideas how to stop default keys for just the text box in question?
I am aware that access 2007 has keyDown event for reports but access 2003 does not. My client's system is written in 2003 and he is not willing to invest in 2007.
Is there a way to have the report print by selecting F6 after the customer views the reports contents to see if they are correct.
I've posted this on a couple other forums with no nibbles. Anyone here wanna lend a hand?
I have a number of cmdButtons on a Parent Form that changes the SourceObject of a subform. I would like to give the user the option of using the Right Arrow key to SetFocus on the subform. I know I can do this on each cmdButton using the KeyDown event but what I rather do is create a function to accomplish this so I don't have to code each and every button. My problem is I'm new to creating functions, subs and etc. Could I get someone to lend a hand in accomplishing this, please?
1) a delete button (to delete a record) 2) a Search Payee box (that lists all payee names) 3) an SSN text box
I have code in the "On Enter" event of the SSN text box that pops up a message box asking which way to format the SSN (regular or as tax id). This works fine when entering a new record.
I just discovered, however, that when I delete a record then this message box comes up as well and I don't want it to. Instead I want to use the code "srchPayee.SetFocus" after a record is deleted to move the cursor/focus to the Search Payee box so that the SSN message box does not invoke.
I've tried putting the "srchPayee.SetFocus" in events on the form and also on the delete button, but no matter what I do the SSN message box still pops up after the record is deleted. Which event can I put this code in so that after deleting the record the focus moves to the Search Payee box and the SSN message does not appear?
Form1 has a sub form, Form2, which have a tab control with a number of tabs. One of them, Tab4, includes a sub form, Form3.
I have an SQL statement that I want to run (using DoCmd.RunSQL) when Form3 is shown on screen the first time, e.g. when Tab4 activates. I've tried OnClick for Tab4, OnActivate for both Form3 and Tab4 along with a dozen other events with no result. Maybe the problem is that the tab control is also in a subform?
I have a combo box with 'yes' and 'no' as options. The default is 'no'. When a user changes it to 'yes', I need to make several text boxes visible on the form. Q. Would it be better to user the OnChange or AfterUpdate event and why?
Can someone help? I am working on an event database (based on Microsoft 2003 event database template). At present when I register attendees, I can preview an invoice which is generated based on the information I have entered.
I have set up another option to preview a Letter of Confirmation based on this same principal. As I am "Visually Basic" challenged, I simply 'copied & pasted' the event procedure and made the changes as needed to ensure the correct report was opened (ie not the Invoice report but Confirmation Letter report).
However, when I click the button to open preview the letter, the "Print Invoice" box also opens up (as it does when previewing the invoice). I don't want this box to open as I don't need to enter any details.
Can someone please have a look at my VBA event below to see what I would need to delete to stop the "Print Invoice" box from popping up.
Private Sub LOC_Click() On Error GoTo Err_ConfirmationLetter_Click If Me![Attendees Subform].Form.RecordsetClone.RecordCount = 0 Then MsgBox "Enter attendee and registration information before previewing the Confirmation Letter." Else DoCmd.OpenReport "ConfirmationLetter", acPreview, , "[RegistrationID]=" & Forms![Attendees]![Attendees Subform].Form![RegistrationID] End If
Exit_ConfirmationLetter_Click: Exit Sub
Err_ConfirmationLetter_Click: If Err <> 2501 Then MsgBox Err.Description End If Resume Exit_ConfirmationLetter_Click End Sub
Many thanks for any help. Kath Price Auckland, New Zealand
PS - Below is the original 'Preview Invoice' event that I copied: Private Sub PreviewInvoice_Click() On Error GoTo Err_PreviewInvoice_Click If Me![Attendees Subform].Form.RecordsetClone.RecordCount = 0 Then MsgBox "Enter attendee and registration information before previewing the invoice." Else DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.OpenReport "Invoice", acPreview, , "[RegistrationID]=" & Forms![Attendees]![Attendees Subform].Form![RegistrationID] End If
Exit_PreviewInvoice_Click: Exit Sub
Err_PreviewInvoice_Click: If Err <> 2501 Then MsgBox Err.Description End If Resume Exit_PreviewInvoice_Click End Sub
Hello, In an empty field how to detect that the RETURN key has been pressed, i don't know hot to differentiate the RETURN KEY and the field exit by clicking the mouse in an other field because in the 2 cases the value of field is set to "", is there a way to test VbKey in a field ?
This because i want to set my field to a default value only when i press RETURN and i don't want the LostFocus or Exit set my field to this default value if nothing has been typed in my field. (I must precise that for some reasons in my form the KeyPreview is set to TRUE.)
In my database I track a program called Bridge. Once you open bridge you can have anywhere from 1 to 7 "Sessions". Each bridge is assigned a number IE LT175A. If there are mulitple sessions they are numbered LT175A, LT175B, LT175C etc. I have a check box in my database that shows if bridge is installed on that PC. If it is then my section for session numbers are visiable, if bridge is not checked then the session numbers section isn't visiable. I currently have my Event Procedure in the After Update section. My code works because if I unclick on bridge my sessions disappears. However when I go to the next record if bridge is checked then my sessions are visiable but on the next record where it isn't checked it still displays the session section. So it isn't adjusting itself from record to record. Does my code need to go someplace else or am I doing something else wrong? Here is the code I have:(and it's under After Update)
i have been sick for quite a while,But back on track now.In the past i was building a car event db and would like to finish it.I have checked it out and there seems to be a few errors that i can't remember anything about.
you must have outlook installed otherwise some missing references come up.also there seems to be a problem with the date on the invoice form,the backup section in utilites.
If someone could have a look and point me in the right direction it would be greatly appreciated.
I'm working with a database with employess info in access, When I click on an employees name in a form, I want to fire off another form with there info, what I have now it does nothing.
I used the following code in the on close event of my form and it works when the value of [maingameformation.playid] is not previously entered but if there is already a value there it won't overide it? Is this possible to do?
Private Sub Form_Close() [Forms]![gameentryfrm]![maingameformation.playid] = Me.playid End Sub
I have a form with a subform. I have an event on dbl-click on the subform's detail section, I want to display yet another form - frmDatePopup depending on a value in that subform. frmDatePopup has an Eval(Forms!frmDates!Start) for criteria for my date field. The problem is that when I dbl-click on the subform's detail section, frmDatePopup comes up blank, as if it ignores the Eval statement. Any suggestions on what I need to change to make this work? Thanks.
I have just joined this forum so I apologize if this question has already been asked, although I did do a search first. Here is my question:
I'm reading the Microsoft Press book, "Microsoft Access Version 2002, Inside/Out" by Helen Feddema. On page 846, in talking about how to use Form Event Procedures, she shows how to open a form's object property then click on the event tab so that you can enter code for the appriate event procedure. Her event tab of the form properties sheet shows more events than my pc does for Access 2002 (my Access help shows I'm running version 2002). Her event tab starts with "On Current" then "Before Insert", "After Insert" then "Before Update" while mine starts with "Before Update". She shows many more events than what my PC has and I need to use some of the missing ones. Anybody have an idea what's wrong or what I have to do to get the missing events to show up on my PC?
hi , i am new to access ,specially in designing forms . I have two tables Table1 and Table2 .I have created forms ,Form1 and Form2 respectively. now what i want is ...when i enter the value in Form2 ...Table1 filed should be updated. Table1.field1=Table1.field1-Table2.field1 how can i perform this type of action ?
OK, this form has a series of buttons that lead to other forms or open up into reports. The problem is I can't figure out how they do that. On the click event procedure of one of the buttons it says =HandleButtonClick(1) . This is NOT a macro. I don't think it's a command button either usually those say [Event Procedure] in the click event. I can't figure it out. Anyone have any suggestions please?
Hi all I am using the OnCurrent event even to check various about the contents of the current record in a form and ask for additional data where necessary with InputBox, but if it finds missing data on the first record when the form is opened, it displays the box before the form is on the screen. How can I make it display the form first? Fiona
By utilizing the search feature, I have discovered issues that are somewhat relative to what I need assistance with, however nothing specific. So here we go…
1.I have a table named tblManifest. Within this table is a text field named PRODUCT and a text field named ACTION (which is a YES or NO option). There are multiple records (duplicates are acceptable) stored within this table/field 2.I have a form named frmReceipts. Within this form is a text box named PRODUCT. Here is my issue. Within frmReceipts & text box PRODUCT, the user will utilize a handeld scanner to scan a product id barcode. After the scan, I want the record to be added to a table named tblReceipts. This is I have.
My problem is with product identity and specialized treatment of specific product id’s. What I need is when the user scans the product id and that particular product id is flagged as YES within the ACTION field in tblManifest, I would like for a separate wav file to be played and a comment box to flash on the screen. This will alert the user that the product requires specialized treatment. The wav is located in C:My DocumentsTest.wav. If product is flagged as NO, then no wav should be played and no comment is displayed.
I would imagine that this is possible, however beyond my basic Access skills. Thanks in advance for any assistance.
End Function ````````````` What I am trying to get to is to have the text box event...Private Sub Text0_AfterUpdate() ...... Be a Form event... So the code would apply to every text box on the form. Tried it on different form events..... Cant get it to work. Any ideas????
I have a form that I use for navigation in my database. It consists of links to the left to swith between forms, and a subform in the middle. When a link to the left is clicked, I run code to switch the source fo the subform:
me.subfrmFrame.SourceObject = "frmSubCustodian"
I want the form to "remember" the last record the user was on, so I created a table and am writing the primary key of the form to the table on the form's unload event. Then, on the form's load event, I'm looking up that key from the table.
When I open and close the form by itself, not as a subform of my navigation form, everything works fine.
When I open the form from the navigation screen, everything is fine.
When I switch to another form on the navigation screen, however, I have a problem. No matter what record the form was on, it always writes the primary key of the very first record.
Hi, I have a form which has two separate subforms in it. When the user selects a record in the first subform, I want the values of that record to write to the second subform's fields. OnCurrent works when there is more than record in the subform. My problem is two fold, one I don't want my copy code to run when the form loads and I need it to copy a record when there is also only one record in the subform.
Which event do you recommend?
Also, does anyone have a suggestion on how to allow the user to tab through a form, but really only record by record (with the keyboard) and not having to go through all the fields before getting to the next record.
How can I make the form cannot close if the field is Null when I click the close button?
frm1: Field Name: Date, Id, Name
The 3 field names are required to input.
Before Update Event: if (isnull(date)) then date.setforce end if if (isnull(id)) then id.setforce end if if (isnull(name)) then name.setforce end if
It works well when I go to next record (suppose I miss one field) However, It doesn't work when I click the close button, the form is closed. I want the form cannot close until fill out all fields. It cannot go to the missing fields.
I have a question, when I click close button, Must the form be closed even though I set up the field to be "setforce"?