Thanks for replying so quickly!
I actually found a solution on the following link regarding the Form.AfterDelConfirm event: http://msdn.microsoft.com/en-us/library/office/ff193473.aspx
There's an example there of using a select case statement to determine whether the deletion occurred or...
Hi,
Is there a way in a form's BeforeDelConfirm or AfterDelConfirm event to detect the response to the confirmation dialog box Access displays when a user deletes a record?
I'd like to force a subform to requery if "yes" is chosen in the dialog box.
Thanks!
Hi, jdraw
No harm done. Since deleting the relationship...and later restoring it....I realized that the error stemmed from running the insert into sql statement in the BeforeUpdate event. The key violation occurred because I was trying to append a record containing data in a field that had...
Hi,
I figured it out. The table I was trying to append to had both of the fields I was trying to write values to each linked to a specific field in each of two respective tables in relationships. I deleted one of the relationships and the query worked o.k.
Hi, Paul
Thanks for the quick reply! I tried using CurrentDb.Execute instead of DoCmd.RunSQL. The good news is I didn't get the key violation error. The bad news is that no record got appended to the table when used Me![txtProjectEntityID] and the variable y in the SQL statement. When I...
Hi
I'm trying to run an "insert into" query as a before update event in a form. The code is the following:
DoCmd.RunSQL "INSERT INTO tblProjectEntityLocation ( ProjectEntityID, EntityLocationID ) VALUES (" & Me![txtProjectEntityID] & "," & y & ");"
I get a key violation error when this...
Hello everyone,
Sorry to have taken so long to post how this turned out.
I finally got around the locking problem by creating a subform, "subContactLocationShell", that has no parent/child relationship to the main form, but which has a single text box which contains a ProfessionalContactID...
Hi, Bob
There are no bound controls on the main form, so I can't set the subform's master/child property to anything. The main form has several unbound text boxes the user fills in with search criteria to find a contact. When the user clicks the search button on the main form, the on click...
Hi, Bob
I'm using the BeforeInsert event of subContactLocation to populate three text boxes in the header of subContactLocation with information from subContacts. Here's the code:
Private Sub Form_BeforeInsert(Cancel As Integer)
'This event only fires if this is a new record
'If this is a...
Hi, Bob; Hi VilaRestal
Thanks for your code! I tried each and got mixed results.
First, some background regarding the form and subform:
I have a main form called frmContact used for finding contacts from a database and displaying information about each contact. The user enters information...
(Sorry! My previous post was missing a line of code.)
Hi, spikepl
I'm afraid I can't find the extra End If. I tried putting the Cancel = vbCancel in as shown in the code below. I ran into the same problem.
If Me.NewRecord Then 'Test if this is a new record.
Dim ctl As Control
Dim i As...
Hi, spikepl
I went into the code window and compiled, then opened the form, triggered the event that runs the code, closed the form, closed the database, and had the same locking problem.
Are you seeing something specific in the code?
Thanks.
Hi, this is the first question I've posted. If I'm not using the right forum, please let me know.
I've created a For Each loop in the before update event of a subform to check whether any text box in the detail section contains data. If at least one text box is not null or empty, the record is...
Hi, All!
I'm a new member, but a long time user of this site. I've been using Access on and off for years, but have never become proficient at programming. You're my primary source of help whenever I'm stuck, and this forum has saved me many times.
Thanks!