User Profile
Collapse
-
adding a requrey takes it back to the 1st record if the user clicks yes, instead of going to the previous record. And, it doesn't delete the record. -
I've added the End If. Now there are no errors but it is also not deleting the record.
...Code:Private Sub cmdDelete_Click() Dim blnLast As Boolean 'Msgbox call must return the value in order to be checked If MsgBox("Are you sure you want to delete this record?", vbYesNo, "Deleting Record") = vbNo then Exit sub With me blnLast=(.CurrentRecord=.Recordset.RecordCount)Leave a comment:
-
Ok, I used the following code and got an error saying End With without with.
...Code:Private Sub cmdDelete_Click() Dim blnLast As Boolean 'Msgbox call must return the value in order to be checked If MsgBox("Are you sure you want to delete this record?", vbYesNo, "Deleting Record") Then If vbNo then Exit sub With me blnLast=(.CurrentRecord=.Recordset.RecordCount)Leave a comment:
-
Ok so, I've put together this code but wanted you to look at it so I don't delete something I shouldn't...lik e my whole form or something.
...Code:Private Sub cmdDelete_Click() If Me.Currentrecord = Me.Recordset.Recordcount then Msgbox "Are you sure you want to delete this record?", vbCritical, "Deleting Record", vbYesNo If vbNo then DoCmd.CancelEvent Else If vbYes then
Leave a comment:
-
Delete button not asking if the user wants to delete record first
I used the button wizard to set up a delete record button. It does delete a record and then moves to the next record, however I need it to ask the user first before deleting and also if it is the last record I need it to return the previous record.
I'm not real familier with working with macros.
Is this an easy fix or should this be in code instead?
v/r,
jason -
2010. Ok, so setting it on_current to specific colors when the checkbox is checked and specific colors when the checkbox is unchecked works. However, for the white font, I had to use rgb instead of the regular number. the background I could use the number.
Thanks, what a pain that was...Leave a comment:
-
no, the textboxes are not locked and I tried setting the back and forecolor of the textboxes both when the checkbox is checked and when it is unchecked. When I am on a record that has it unchecked it works, when I get to a record that has it checked, the textboxes and combobox are backcolor red. Supposed to be dark grey with white font.Leave a comment:
-
yes, it does disable the field however it won't grey it out. Is that becasue they are tied to a combobox or rather, getting their data from the combobox selection?
Any way around that?Leave a comment:
-
Thanks for the explaination. My database is on a secure network so I can't copy/paste. It compacts/repairs if that is what you are referring to.
Not so sure it is a code problem...even when I set the textboxes to not enabled in the properties they are disabled but don't become greyed out like the combobox does.
While several other textboxes (not related to comboboxes) become greyed out when checkboxes are checked/unchecked,...Leave a comment:
-
Not sure what "Air-code" is but by all means, don't waste your time.
And by the way, that code didn't work, it still only disables the combobox.Leave a comment:
-
Code:Private Sub Form_Current() If CkMisc = -1 then Rank.enabled = false FirstName.enabled = false MI.enabled = false LastName.enabled = false Else If CkMisc = 0 then Rank.enabled = true FirstName.enabled = true MI.enabled = true LastName.enabled = true End If End If End Sub
Leave a comment:
-
cannot disable text boxes that are associated with a combobox
I have text boxes: Rank, FirstName and MI that are populated based on the combobox LastName.
When I check the checkbox CkMisc the textboxes and the combobox should be disabled.
The LastName combobox does become disabled when the CkMisc is checked, however the textboxes associated with that combobox do not.
How can I make the textboxes become disabled when the CkMisc is checked? -
SeadooRider started a topic cmdNext button continuing to next record even when there are no more recordsin AccesscmdNext button continuing to next record even when there are no more records
How do I create a msgbox when the last record has been reached in a form in access 2010? -
The only difference I see is the capital C in click. that was a typo, the actual code does have a capital C but it still doesn't work.
If I'm missing something completely here please dummy it down for me.Leave a comment:
-
Sorry, let me clearify. If the checkbox CkPhoneListOthe r gets checked and the PhoneListOther text field is blank or null, then I need a msgbox to appear. If the PhoneListOther text field is not blank or null then the user should be able to check the checkbox without any msgbox poping up.
Hope that makes more sense
JasonLeave a comment:
-
SeadooRider started a topic Checkbox checking for null or blank field prior to msgbox popup not workingin AccessCheckbox checking for null or blank field prior to msgbox popup not working
The following code works for one checkbox with same code with different checkbox and textbox names, however this one brings up the msgbox even if the required field it is checking DOES have text in it.
CkPhoneListOthe r is a checkbox
PhoneListName_P os is a textbox
Both are bound to fields in the table
...Code:CkPhoneListOther_AfterUpdate() If CkPhoneListOther = -1 and Nz(PhoneListName_Pos, "")
-
cmdNext Error Msg not working
I have the following code for a next record button in an access form that won't bring up msgbox after last record is reached.
Please assist,Code:On Error goTo_cmdNext_click DoCmd.GoToRecord, , acNext Exit_cmdNext_click Exit Sub Err_cmdNext_click Msgbox "No more records etc.", , "Last record" Resume Exit_cmdNext_click End Sub
JasonLast edited by TheSmileyCoder; Apr 11 '13, 12:58 PM. -
-
Hmm, never seen that before. I had tried Is Null but that didn't work either. the Nz thing worked great.
thxLeave a comment:
-
Also, the second one works if I put And PhoneListName = "1" and then if there is a 1 in the field it works correctly.
So, it has something to do with the ""Leave a comment:
No activity results to display
Show More
Leave a comment: