how to get a "sound" to occur everytime a certain message box pops up.I wrote the following code which currently allows the MsgBox to open when the criteria is met, BUT it does not make a sound when opening. I followed the instructions as per this link URL....
Private Sub Open_frmAccessories_Click()
If (Me!txtProductGroup) = 9 Then
MsgBox "This Product Does Not Have Any Accessories", -vbExclamation, "NO Accessories for this Product"
Exit Sub
Else
[code]....
I have attached a copy of the pop up box to show it is working correctly, albeit without the sound function. Curiously, if I click on any button in the Products main screen behind the Error Msg box, i.e. "New" or "Close" the SOUND occurs at that point!
I have a 'display only' form, which updates a company's sales totals every five minutes. I would like to add a beep or other sound when the screen updates. Is there any way to play a sound or beep from Access or SQL?
So i am building a DB for my work and i am having alot of fun with it today and showing my geek/nerd side and putting a few sounds to give it some flair, good idea if the users can mute the sounds. what i have is a module with my sounds and then call fuctions where i want it to play, i have looked around but can't seem to find a way to mute, i was hoping for a button i could put on my login form to mute the sounds.
Option Compare Database '************************************************* **************** 'Declarations section of the module. '************************************************* ****************
Declare Function apisndPlaySound Lib "winmm" Alias "sndPlaySoundA" (ByVal Filename As String, ByVal snd_async As Long) As Long Public Function playwavefile(sWavFile As String) 'Purpose: Plays a sound.
Hello, I am still wet behind the ears in regard to Access so your help and support is much needed.
I have created a form in Access where i am having trouble with a textbox. In short this box is called [Shift] i want it to be populated by the result the system returns in another Textbox which is called [Time], this box is set up as Time(). So below is what i need it to do when the Form is used.
Textbox: [Time] = (07:00 - 14:59) would return "Earlies" in Textbox: [Shift] Textbox: [Time] = (15:00 - 22:59) would return "Lates" in Textbox: [Shift] Textbox: [Time] = (23:00 - 06:59) would return "Nights" in Textbox: [Shift]
I have tried the VBA below without success in this task so i can only assume it is due to the fact that the Time field is system generated or the fact it is in time format:
I have a form "NewMetalF" that has three combo boxes. The first one is used to choose "Precious Metal" or "Base Metal". The second one shows all the metals based on the first combo box. When I open the form in form view alone the combo boxes work flawlessly. I run the form "NewMetalF" within another form "NewExternalPartF" by clicking a button "AddMetal". When the button is clicked "NewMetalF" opens. The first combo box is selected, and when the second combo box is clicked the error "Enter Paramater Value" "Forms!NewMetalF!cboPreciousOrBase".
I have used a command button placed next to the project name box which if clicked opens up a finance details form for the project name box.
Problem is if that project does not have any finance details it still opens up the form but just comes up as totally blank.
Is there anyway i can get an error message to come up and say "No matching data found for this project" when they click the command button to open up the finance form, but there is no finance data?
I have tried but unsuccessfully.
I entered this code
Private Sub Label75_Click() On Error GoTo Err_Label75_Click Dim stDocName As String Dim stLinkCriteria As String
stDocName = "Contract Filtered"
If Combo22 = "" Then MsgBox "No Matching Data Found", vbExclamation
I have a form that have a calculated field which generate a series of numbers. Correct and usuable numbers. Now, all I want to do this is to total (Sum)that numbers up at the Form Footer.. I have a Text Box control on the form footer for this. And formula on the Text box control is this.. =Sum ([Dhrs]*[Davg]). I got error everywhere on my form when I open the form..I have been trying using NZ Sum etc..
That is so that each show has the month and year attached to the name, so its easier to find out when they were, from just looking at them in the list box.But, if I use the search that John (The OP of that link) then if I were to search for 2015, and try to open a show, it just opens to a blank frmEventsEdit1. Even though I currently just tell it:
I'm building a simple database for storing records about books.
I'm currently working on one of the data entry forms. Part of this form is supposed to enable the user to add details about the book and the series that it belongs to (if it does belong to one).
The relationship is One-to-Many: One series can have many books. I've made the series part a sub form.
When I enter some data to test that it works, I get an error message when I try to add a new series using the sub form. It says:
"You can't assign a value to this object. *The object may be a control on a read-only form. *The object may be on a form that is open in Design view. *The value may be too large for this field."
As far as I know there isn't anything wrong, so I'm not certain why this error message comes up. I think it may have something to do with the primary key being the AutoNumber data type, but I just click 'OK' and ignore it, and it works fine.
The database works as far as I can see, I just want the error message to stop appearing.
I have built a database which has a number of forms with a frm_PartNo subform in.When ever I click a button to load one of these forms I get the following error message: ECN Database v1.31 cannot find the referenced form 'frm_PartNo'. But when the form loads the sub form is there with all the related data !
I'm getting an error on some fairly simple code attached to a form's Unload event, but I'm only seeing it when I switch my form to design mode. My code does look like it's working under normal conditions,I've attached a simplified database that reproduces the problem in all its glory. I've searched for similar problems and solutions but none have quite hit the spot.
The code is supposed to prevent users closing a form if they haven't entered at least one record in the subform. In my attached example, you shouldn't be able to close the form if you are currently on a Person record that has no linked Hobby record. Do do this, I have used the following code in the Unload event of frmPerson:
Code:
Private Sub Form_Unload(Cancel As Integer) If Me.frmhobby.Form.Recordset.RecordCount < 1 Then Call MsgBox("you must enter at least one hobby for this person") Cancel = True End If End Sub
To see it working properly, go to Person record 3 (Laura Blackwood) which has no Hobby records, and try to close the form. You can't close it until you have entered a hobby for this person. As far as I can see the code works as expected.
Now navigate to Person Record 4 (Mary McArthur). Instead of trying to close the form, switch the form to Design View. You will get the following error: "Runtime error 2455: You entered an expression that has an invalid reference to the property form/report". Return to Form view and navigate to record 2 (Kevin Petersen), then switch back to Design View - same error. Interestingly, you don't ever get the error on Record 1. All this is exactly what happens on my real database too.
So I'm worried that my code isn't right despite appearances. I thought switching to Design View just goes through the same Unload-Deactivate-Close routine as when you close a form in a conventional way? I also know that subforms unload after forms, so since the code is attached to the Form, the subform should still be available to it and shouldn't result in a reference error.
I have written the following code for checking whether a query exists.
Code: Function QueryExists(strQueryName As String) As Boolean '---------------------------------------------------------------------------------------- ' Checks whether a query already exists '---------------------------------------------------------------------------------------- Dim db As DAO.Database Dim tdf As DAO.QueryDef On Error GoTo err_handler Set db = CurrentDb
[code]....
Here I try to intercept the error message in vain.
I have a simple access database which up until now was working as it should. Then i made a Backup of the database Named it something different deleted certain data from the backup and when i went back into the original DB i now have #Name? where it used to calculate 2 fields.
I have a database which displays one form as a subform of another form. Originally the subform was displayed in datasheet view, but now due to changes I am trying to make to the system I want to display this subform as continuous forms. Unfortunately in datasheet view, when a record of the main form has several records (ie enough to require scrolling down the list) in the subform I get errors when scrolling through these subform records.
The error message that access is displaying is "The Value you entered isn't valid for this field. eg you have entered text in a numeric field or a number that is larger than the FieldSize setting permits."
I thought ok, maybe the subform design was duff (I am taking over a system designed by someone else) and so created a new subform, but the error still occurs with a totally fresh subform. The error occurs even when viewing the subform on its own. With a lot of records displayed on screen in the continous forms view I get numerous occurances of the abopve mentioned error message box and access eventually crashes. Yet in datasheet view everything is fine.
It's incredibly annoying as I can't fathom out what is causing the problem and how to fix it and to go about what I am doing in another way (ie without using continous forms) will mean scrapping a whole days work. I also don't like to do things a different way just because I can't get it to work the way I'd like to.
If anyone has some solutions to this problem I would be eternally grateful!
I have a Main form (MainForm) with two subforms (SFormA, SFormB). These SForms are connected to the MainForm by a control (controlA) and connected to each other by a control (controlB) via an unbound control in the main form, in order to change data in SFormB according to selected record in SFormA. SFormB has an on current event procedure determined to show different things depending on the value of a bound control that changes every time I select a different record in SFormA. Everything works fine when Mainform and SForms first load.
But, when I select a record on SFormA I get a runtime error and everything stops, application closes and reopens, creating a safety copy. It seems to me that the on current procedure on SFormB causes this problem, because if I delete it no error appears (SFormB not showing what I want though). Funny thing is I have another database, same design, same structure, same procedures, (different objects and names of course) and it works perfectly alright. I even recreated the whole database still the same error.
I use the switchboard wizard to set up a switchboard. At the moment my main switchboard has 3 items and they are all set to 'open form in add mode' and they all point to the same form at the moment (which does exist).
When I try to go to form view of the switchboard I get the error 'The control name label1 is misspelled or refers to a control that doesn't exist'. Behind it I can see the form in form view and I can see there are the 3 menu items I would expect but when I close the error dialogue and the following 'close macros' dialogue' it goes back to design view. In design view I can only see one menu item (which seems to be a text box rather than a label) instead of 3. I changed it to a label but it didn't work.
A receive a compile error when an OpenForm macro action is executed. The error message is: The form you referenced may be closed or may not exist in the database. Microsoft Access may have encountered a compile error in a Visual Basic module for the form.
This error message keeps popping up no matter what I do. "Database can't find the field 'QuotationNumber' referred to in your expression." I tried to define a text box by using a DLookUp function, however that did not work. I deleted the function, and now this error message keeps popping up. I have searched everywhere for an expression with 'QuotationNumber' in it, and I cannot find it. What do I do?
when i want to open the database in an access database i have the following error. you have as the event property setting the expression entered when open.This expression has caused an error amppu (database name) can not find the form that is referred to
I have been building a new db in my personal drive at work which has been working perfectly, until I transfer it to the main network drive so that others can use it.When I try to open it, I now get an error saying that windows cannot access the file (code 0x80070002) - although it does in fact open it anway, eventually.
I have removed and re-instated various bits of code, and discovered that it's linked to the 'Display Form' function within Access Options > Current Database, that I have used to open the form 'Homepage' when the db is opened. When the dropdown is set to 'None', the db opens fine, but when a form is selected, the error occurs. I have tried using an AutoExec macro to open the Homepage form, but this generates the same error too.
We have a form with the web browser control which links to Google maps and jumps to that location on the map by the lat and long and updates as you jump to each record. (The control is on a form and is only used there) The map itself works however i get a script error every time i jump to the next record....
I try to open a web page with a form in access 2007. During the loading of the page it shows me 2 security error messages.
I tried to change the properties in Activex and especially the Silent property from No to Yes but this is not possible. In the next restart of the form restores the original settings.
When i open the same page with Internet Explorer it doesn't show any error. I have attached the database example to see exactly what happening.
I have a form which uses a list box to select which record to display. The code is all generated by Access during form design. It is a method I have used numerous times inthe past in various database without problem (even in the current database I am developing).But for some reason on this one form I get the following error;-
"The expression After Update you entered as the property setting produced the ollowing error; A problem occurred while database was communication with OLE Server or Active X Control".
Can I use the Like command in an If Then statement? I'm getting a syntax error
If [Primary1Name] Like 'PO*' Then MsgBox "You cannot use a post office box address. Use a residence address.", vbOKOnly, "Incorrect Address Information" DoCmd.GoToControl "Primary1Address1" Else End If