Message Box To Appear With Comment And OK Button
Dec 23, 2013
I have a command button with the VBA code below. I'd like a message box to appear with a comment and an "OK" button that continues the code below . . is this possible?
Private Sub cmdDuplicateOverpayments_Click()
On Error GoTo Err_cmdDuplicateOverpayments_Click
Dim stDocName As String
stDocName = "qryFindduplicatesforOverpaymentsDetails"
DoCmd.OpenQuery stDocName, acNormal, acEdit
[Code] .....
View Replies
ADVERTISEMENT
Aug 22, 2006
This is probably very simple, but how and where do I add codes to the button where a confirmation message pops up? Like, "Are you sure you want to save?" or "Are you sure you want to exit?"
For Example: Save and Close button
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
DoCmd.Close
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
End Sub
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_cmdSave_Click:
Exit Sub
Err_cmdSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
End Sub
Thanks in advance!
View 7 Replies
View Related
Nov 29, 2005
I have a "Browse" button on a form that works fine. I would like to add a Message Box that warns the user that if they click "ok" on the message box they will start browsing, and if they dont want to do that click "cancel" in the message box. ( I know its obvious, bu thats what my friend wants). Is there an easy way to do this?
View 2 Replies
View Related
Mar 1, 2006
Hi everyone
I posted this question about an hour ago but I seem to have been logged out by the time that I actually pressed "send", so I don't know whether it was posted correctly - I can't find it!
I've created four buttons on a form to negotiate my way through the records. When I come to the end, a message box is shown stating that the next record cannot be found (it doesn't exist). Can I trap this message and use it to activate some code? I thought about a form popping up (in "corporate" colours to match the remainder of the database) or a form asking whether I want to add another record.
I looked at the code that Access generated when I made the buttons, and I saw the following:
Err_MyButton_Click:
MsgBox Err.Description
Resume Exit_MyButton_Click
I "remmed" out the middle line, but the automatic message box still appeared. I added a line of code: <MsgBox Err.Number>, but that didn't give a result, so I guess that the message box that's being shown isn't generated via this snippet of code.
I know that I could disable the relevant button when the record number reaches the end or add another button to add a new record, but I'd like to trap this automatic message box. Can I do so, and, if so, how?
Thanks for your time.
View 1 Replies
View Related
Aug 1, 2006
I use a close button to close a form. There is list box in this Form. If the list box is empty, then simly close the form. However, if there are projects in the list box, I want to give a warning. If the user say YES, then everything in the listbox will be deleted and the form will be closed. If user say NO, tehn the form will not be closed. They then can use anotehr button to save teh projects.
I wrote the follwing code. The delete portion itself works. But it seesm comfused with msgbox. Could you pelase help me correct this code? Thank you very much for your help.
lbDestination -- list box name
Private Sub Close_Click()
On Error GoTo Err_Close_Click
If IsNull(Me.lbDestination) Then
DoCmd.Close
Exit Sub
End If
If MsgBox("You have unsaved initiatives. Are you sure you want to close?", vbQuestion + vbYesNo + vbDefaultButton2, _
"Delete?") = vbYes Then
Dim rsDestination As DAO.Recordset
Set rsDestination = CurrentDb.OpenRecordset("tbInit", dbOpenDynaset)
rsDestination.MoveFirst
Do While Not rsDestination.EOF
rsDestination.Edit
rsDestination.Delete
rsDestination.MoveNext
Loop
Me.lbDestination.Requery
End If
Exit_Close_Click:
Exit Sub
Err_Close_Click:
Resume Exit_Close_Click
End Sub
View 4 Replies
View Related
Apr 30, 2005
Dear All:
I have created a from which contains names, address, ID's and other data.
I wish to place a command button on the form and when it is pressed, a page pops up with instructions on how to use the database.
Any ideas on how to get started?
Thanking in advance,
Dion
View 1 Replies
View Related
Jun 29, 2005
I have created command buttons to enter event registration information after biographical information has been completed. When I click on the button I get the following error message:
"Microsoft Office Access cannot find the field '|' referred to in your expression."
This is the On Click code that I have in there. Can anyone spot the error of my ways?
Private Sub RegisterButton_Click()
On Error GoTo Err_RegisterButton_Click
If IsNull(Me![AttendeeID]) Then
MsgBox "Enter attendee information before registering for an event."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Registration", , , "[Registration]![RegistrationID]=Forms![Attendees]![Attendees Subform].form![RegistrationID]"
End If
Exit_RegisterButton_Click:
Exit Sub
Err_RegisterButton_Click:
MsgBox Err.Description
Resume Exit_RegisterButton_Click
End Sub
Thanks!
View 1 Replies
View Related
Oct 28, 2014
Is there a way to make the ESC key have the same results as the "No" button in message boxes?
View 2 Replies
View Related
Sep 26, 2013
I am not sure where to start or go about creating message box that would display "No results found" if my queries return no results. My search of the forums hasn't been fruitful.
I have created one form that has a text box and a button that works as a search function to run through the tables and displays the applicable queries. Currently, if no results are returned nothing happens. Preferably I would like a message box to display stating that there were "No results found". I would assume that the code would be associated with the "Find" button. Here is the VBA code as it stands, again, I haven't even attempted to add code for a message box.
Private Sub Find_Click()
On Error GoTo Find_Click_Err
If DCount("Heading", "Service Desk Manual Query") > 0 Then
DoCmd.OpenQuery "Service Desk Manual Query", acViewNormal, acReadOnly
End If
[Code] .....
Find_Click_Exit:
Exit Sub
Find_Click_Err:
MsgBox Error$
Resume Find_Click_Exit
View 7 Replies
View Related
Jan 17, 2006
Okay Stupid question, But I have tryed different things and have not got anything to work yet, So I am using Microsoft Acess 2003. I would like to be able to comment out block of code. Thanks
Sorry for the stundness...:confused: :confused:
View 3 Replies
View Related
Sep 27, 2006
Hi,
I wonder if it's possible in Access 2003 to comment a whole paragraph of VBA code with one click instead of commenting each line on its own?
Regards,
B
View 2 Replies
View Related
Nov 13, 2006
Hello,
Really simple one this one. Though I can't find it in the help or in forums. So simple it doesn't rate a mention apparently.
Except that I would dearly love to know how to comment out SQL code whilst writing queries in Access 2000 SQL view. All that retyping and copy/pasting is causing me RSI.
In eager anticipation,
Tim
View 1 Replies
View Related
May 27, 2013
Like in excel, when there's a red triangle in the corner of the field which pops up a small comment box, is there a similar functionality in Access that when a field.
Has either a comment associated with it, that a comment box can be made available?
View 6 Replies
View Related
Jun 20, 2014
I have a field SSEEndDate. I have some records in which this field is empty. What I would like to do is add a comment to explain why the field is empty on a report if possible. Click on it or move the mouse on it or whatever and the comment would show up.
View 14 Replies
View Related
Jul 10, 2015
I am working on a database which will basically serve to be a massive Auditing Checklist. Lots of "Is this done" type yes/no questions to record, some with a comment.
Brief Description: I have many child-forms on a tab-control, each with a different heading/category of things to check for. When someone visits a store, I would like them to record their findings in this form.
In the above example, if the Floors are clean, no input is necessary. If the floors are not clean then the user ticks the checkbox and the text "Floors were not clean" should be automatically entered into the field: Cleanliness 1. The reason for this is that I wish to link the value from this field to a Microsoft Word document using mail merge for reporting purposes, and in the report it needs to state any problems in full sentences.
I have tried using this code in order to update the comment field when the checkbox is ticked, however, the problem with this is that I would have to insert code manually for every single checkbox in my forms, and I have about 150 checkboxes in total.
Code:
Private Sub Cleanliness_A1_AfterUpdate() If Cleanliness_A1.Value = -1 Then 'If checkbox is checked
Cleanliness_C1.Value = Cleanliness_C1.DefaultValue
Cleanliness_C1.Enabled = True
Else
Cleanliness_C1.Value = ""
Cleanliness_C1.Enabled = False
End If
End Sub
View 14 Replies
View Related
Jul 22, 2006
Hi,
Can someone tell me that more remark / comment lines in VBA might be one of the reason of increasing the db size?
Because now a days I am removing the queries from my db and started to use VBA code lines behind each forms and keeping some remark / comment lines to know what a particular set of code line means and what they are doing. So I put everywhere some remarks / comments line. Now my forms are faster than before but the over all size of db become heavy.
Are comment lines one of the reason in increasing db size?
With kind regards,
Ashfaque
View 2 Replies
View Related
Feb 19, 2005
Hi please i have a problem withthis and i need some help,
i received some great help so far thank you So much Markoc.
and now i'm stucj here.
I have two tables :
one called reviews [rid, review]
and the comments [cid, rid, review]
the first two pages work fine, but whenever i click on submit on the second page it take me to the
third one which cannot be displayed.
here is the code on the pages, please if you can help.
------------------------------------------------
on the first page i have " reviews listing "
-------------------------------------------------
<%
Dim oConn, sConnection
Set oConn = Server.CreateObject("ADODB.Connection")
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=xx" & _
"Persist Security Info=False"
oConn.Open(sConnection)
set rsUsers = Server.CreateObject("ADODB.Recordset")
rsUsers.Open "select * from reviews" , oConn
%>
<center><table >
<%
Do while NOT rsUsers.EOF
getrid = rsUsers("rid")
getreview = rsUsers("review")
Response.Write "<tr><a href='viewreview.asp?rid=" & getrid & "'>" & getrid & "</a></td></tr>"
Response.Write "<tr><td colspan='5' width='541' height='25' ><font face='Trebuchet MS'>" & getreview & "</font></td></tr>"
rsUsers.MoveNext
Loop
rsUsers.Close
set rsUsers = Nothing
%>
--------------------------------------------------------------------------------------------------------------------------
the second page is viewreview.asp AND ALSO I HAD A TEXT BOX FOR THE USERS TO LEAVE COMMENTS
--------------------------------------------------------------------------------------------------------------------------
<%
Dim oConn, sConnection
Set oConn = Server.CreateObject("ADODB.Connection")
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=xx" & _
"Persist Security Info=False"
oConn.Open(sConnection)
getrid = Request.QueryString("rid")
strSQL = "SELECT * FROM reviews WHERE rid=" & getrid
Dim rsUsers
set rsUsers = Server.CreateObject("ADODB.Recordset")
rsUsers.Open strSQL , oConn
getrid = rsUsers("rid")
getreview = rsUsers("review")
rsUsers.Close
set rsUsers = Nothing
%>
<center><table cellpadding="2" cellspacing="2" border="0" width="541" >
<tr><td>"<%= getrid %>"</td></tr>
<tr><td>"<%= getreview %>"</td></tr>
</table><table>
<TR>
<TD vAlign=top bgColor=#d6d6d6 colSpan=6>
<form name="comments" action="submitcom.asp?rid=<%=getrid%>" method="POST">
<textarea name="comment" rows="5" cols="50"></textarea>
<br><br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
-------------------------------------------------------------------------------------------
THE LAST PAGE IS submitcom.asp
-------------------------------------------------------------------------------------------
<%
Dim oConn, sConnection
Set oConn = Server.CreateObject("ADODB.Connection")
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\xx"& _
"Persist Security Info=False"
oConn.Open(sConnection)
Dim rsUsers
StrSql = "insert into comments" _
& " (rid, comment)" _
& " VALUES (" _
& "'" & Request("getrid") & "'," _
& "'" & request("comment") & "')"
'DEBUG SCRIPT
'Response.Write StrSql & "<br>"
'response.End
oConn.excute StrSql
set rsUser = nothing
set oConn = nothing
%>
-------------------------------------------------------------------------------------------------
View 1 Replies
View Related
Feb 13, 2015
I have Field "BC1Chng" which requires user input. I want to be able to write a code to reference to "BC1Chng" if there is an input in that field for any record...I want to copy the Remarks into each record in the Remarks Field.
I was able to get the remarks1 field to loop through each record copying what was in that field into each record.
Now I want it to look at the BC1CHng field and only copy to remarks1 field if there is any input in that field???
View 9 Replies
View Related
Jan 13, 2015
Here is my code...if I take out the where statement..it copies the remarks all the way down my table to all the records...with the where statement..it's prompting in for parameters..
Private Sub Remarks1_Click()
Dim strMsg As String, strQry As String, strRemark As String
strMsg = "Update All Comments in the Current view. IMPORTANT!!! Will update a the Viewed records."
[Code].....
View 2 Replies
View Related
Jun 21, 2014
I just want to know if i can create a vba code or a module that will search text or comments in specific table that has attached pdf file.
View 1 Replies
View Related
Sep 17, 2013
I have a tblCommets that has 2 columns in it. The first is an identifier (1,2,3) and the second column is a comment associated with that identifier. Is it possible to use a query to pull that comment based on a user selection? So, if the user selects 1 then the comment associated with 1 is pulled, but if the user selects 2 then that comment results.
Code : =Select[tblComments].Column(2)
View 1 Replies
View Related
Aug 6, 2013
I have a comment box that was just for text. I have been asked to adapt this to allow a web URL to be typed in which would then become a clickable hyperlink (like typing in a Word document). Is this possible?
View 3 Replies
View Related
Jan 15, 2014
I have a form which has a button to email the data out in a standard email message.
Private Sub Command60_Click()
Dim MyDb As dao.Database
Dim rsEmail As dao.Recordset
Dim sToName As String
Dim sSubject As String
Dim sMessageBody As String
[code]...
This works well enough, however, FIELDS 11 through to 16 contain the venue address. This is all we ll and good if every field of the venue address is populated. here are times when not all of the fields are populated, for instance, the address might only be 5 lines.I know I can do this using IIf statements on a report, but how can i achieve the same thing for the email.
View 6 Replies
View Related
Aug 28, 2013
I have after much stress gotten my comments history field to appear on a form.
The following code gives me what I needed
Code:
=ColumnHistory([RecordSource],"LastUpdateBy","[ID]=" & Nz([ID],0))
I have only one simple thing left, that is perplexing to say the least.
Some comment fields will be many short notes, spread over time.
My desire is to change the sort order of the results so the most recent (rather than the initial) comment is at the top.
View 5 Replies
View Related
May 4, 2006
I just can't figure this out..I have two fields in my database that I want to be able to have a regulation that if the user Enter Yes to field1 than they MUST enter some comment on field2. They can't skip it. However, Field1=No, they can skip field2..Is this possible? is this have something to do data validation? Please help..thanks in advance..
View 2 Replies
View Related
Feb 19, 2014
I have created a web-database (? - There are globes over all the forms and tables icons) based on the Issues & Tasks template. This means that most of the data is entered and seen on the "Main" form, which has two tabs - Open Issues and Closed Issues. I have created a form that allows people at my work to input the necessary data and save it, so that it will show up on one of the two tabs. However, once a record has been created, I want to be initially locked if the ID/PK is clicked, so that data can't be changed or entered inadvertently.
SO, I changed the code so that when the ID/PK for a record is clicked, it brings up a different form, but one that looks exactly like the one that is brought up when entering a new form, but I locked all of the fields so that the information cannot be changed. It seems from what I have read that I can create a button on this form so that when clicked, it unlocks the fields on the form so that they can be changed, and then when clicked again it will lock the fields again. Is this true? If so, how can I do it? Or is there something similar I can do? I have seen codes that I could copy and paste, but I cannot figure out the place to copy and paste codes in Access 2010.
I have changed the Form properties so that Data Entry and all the "Allows" are set to No...
View 9 Replies
View Related