Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting records on popup modal=yes form

Status
Not open for further replies.

ytakbob

Programmer
Jul 20, 2000
105
US
I would like to define a screen as popup ..but this prevents me from deleting the current record that is on the form.
How can I get around this without permanently defining the form as popup = no

Access 97 Bob Schmid
bob_schmid@hmis.org
330-746-1010 ext. 1347
 
A popup form suspends currently executing code until the popup form is closed.

Why not delete the record from the on open event of the popup form. Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Thanks for your response Robert !
The delete button is on the popup form. The user may decide they want to delete the record while on the form. Bob Schmid
bob_schmid@hmis.org
330-746-1010 ext. 1347
 
Bob,

Are you telling me that the code behind your button will not execute because it is part of a pop up form?


I think I am really getting confused.

What does happen when the delete code is triggered.
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Bob,

Are you telling me that the code behind your button will not execute because it is part of a pop up form?


I think I am really getting confused.

What does happen when the delete code is triggered.
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
I get err 2046:
The command or action "SeclectRecord" is not available now
"You may be in a read only dataqbase" - I'm ok here
"The type of object the action applies to isn't curently seleted or in the active view

Bob Schmid
bob_schmid@hmis.org
330-746-1010 ext. 1347
 

You might want to use the following code. This code does not care about the current view of your screen. It does assume you want to delete the record on the form that currently has the focus.



'---------------------------------------------------------------------------------------
' Procedure : Delete_click
' DateTime : 10/3/2002 10:19
' Author : bermanr
' Purpose : Deletes record at current record mark
'---------------------------------------------------------------------------------------
'
Private Sub Delete_click()
On Error GoTo Delete_click_Error
Dim rs As DAO.Recordset
Dim bkm As Variant

bkm = Me.Bookmark
Set rs = Me.RecordsetClone
rs.Bookmark = bkm
rs.Delete
rs.Close
Set rs = Nothing
Me.Requery

On Error GoTo 0
Exit Sub

Delete_click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Delete_click of Module Module1"
End Sub
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top