Hi Pat,
Thanks for ur reply. The bizarre thing which I had also mentioned earlier is that if I use a numeric value as Id instead of text, it shows the confirmation msg. If "Confirm Record Changes" is unchecked it shouldn't fire at all. Anyway I have checked in the settings and found alright.
Robin
User Profile
Collapse
-
Thank you NeoPa and Pat.
Firstly, let me tell you this is my first project in Access. I wrote the following Delete_Click sub to delete records in form Patients. I wanted a custom delete confirmation, so I added the BeforeDelConfir m event. Until this point everything working in order when I decided to change the Id field from numeric to text (PT0001, PT0002,..) and made the changes in the code accordingly. But I found records are deleted...Leave a comment:
-
I figured out that I have converted the ID field from integer to text (PT0001,PT0002, ..) which caused the problem. But do not find any apparent reason how it may cause the problem.
I tested with entering numeric Id in the table and delete confirmation works. Please help.Leave a comment:
-
BeforeDelConfirm stopped working
Hi,
I had this perfectly working form "Patients" where I had a custom delete confirmation in BeforeDelConfir m event. But suddenly I found out that the delete confirmation is not working. I have no clue what went wrong. I put a Debug.Print in the BeforeDelConfir m sub to see if it fires at all. As I guessed it is not fired and delete command continues without confirmation.
I created a new form "Patients1"... -
robin27th replied to Table already open through user interface and cannot be manipulated programmaticallyin AccessBoth of your suggestion gave the 'invalid argument' error. However the following statement worked.
Code:Set rs = db.OpenRecordset(sql, dbOpenDynaset, dbReadOnly)
Thanks for the clue Pat.
RobinLeave a comment:
-
robin27th replied to Table already open through user interface and cannot be manipulated programmaticallyin AccessSorry, I am on a slow connection, so same reply posted several times erroneously.
Dmax would not work on a text field and I might encounter similar situation in future. So I would rather want to know how to work with a recordset, if possible. Any suggestion?
RobinLeave a comment:
-
robin27th replied to Table already open through user interface and cannot be manipulated programmaticallyin Access...deleted.Leave a comment:
-
robin27th replied to Table already open through user interface and cannot be manipulated programmaticallyin Access...deleted.Leave a comment:
-
robin27th replied to Table already open through user interface and cannot be manipulated programmaticallyin AccessPat,
The error occurs at line 12.
Basically the ID values have PT prefix and rest six digit increases i.e. PT000001,PT0000 02,PT000003.Code:Set rs = db.OpenRecordset(sql, dbOpenDynaset, dbOptimistic)
I used a numeric ID and used dmax which works fine.
I guess its an issue with opening a recordset on a bound table. I tried a query...Code:lngNextID = DMax("Id", "Patients") + 1Last edited by robin27th; Sep 13 '10, 06:42 PM.Leave a comment:
-
robin27th started a topic Table already open through user interface and cannot be manipulated programmaticallyin AccessTable already open through user interface and cannot be manipulated programmatically
Hi,
I have a form which uses table 'Patients' as Record Source and type Dynaset. I have a 8 digit text id field which starts with 'PT' (PT000001). I wrote the following code to get the next maximum ID on a new record.
...Code:Private Sub Form_Current() Dim db As DAO.Database Dim rs As DAO.Recordset Dim sql As String Dim strNextID As String If Me.NewRecord Then -
How to check for empty string?
Hi,
I am very new to access. I am asking something basic.
How to check if variable strAbc has a value/is not an empty string? I tried isNull and isEmpty and both returns false whether strAbc is assigned "" or "a".Code:Private Sub Command12_Click() Dim strAbc As String strAbc = "a" MsgBox IsNull(strAbc) MsgBox IsEmpty(strAbc) End Sub
...
No activity results to display
Show More
Leave a comment: