Microsoft
Software
Hardware
Network
Question : How can I use double click function on a subform datasheet to open a new form with a specific record?
So I have a form with a subform with a datasheet. I want the user to be able to click on a specific record on the datasheet to open a form with the specific record.
So I have this code on the doubleclick property
DoCmd.OpenForm ("comform")
'DoCmd.OpenForm ("comform")
Dim strWhere2 As String
'Build up a SQL string on the fly
strsql2 = "SELECT * FROM ComCon "
strWhere2 = "1=1"
If Not IsNull(Me.ID) Then
strWhere2 = strWhere2 & " AND ID = '" & Me.ID & "'"
End If
strsql2 = strsql2 & " WHERE " & strWhere2
Forms!comform.Form.RecordS
ource = strsql2
when i double click i get the error saying " you canceled the previous operation" runtime 2001.
I also tried
Forms!comform.RecordSource
= strsql2 but i still get the same error.
thanks,
Answer : How can I use double click function on a subform datasheet to open a new form with a specific record?
oops! try this:
Dim strWhere2 As String
'Build up a SQL string on the fly
strWhere2 = "1=1"
If Not IsNull(Me.ID) Then
strWhere2 = strWhere2 & " AND ID =" & Me.ID
End If
docmd.openform "comform", ,,strWhere2
Random Solutions
Firebird AutoID VB.net code
I need to change the color of a DataGridView scrollbar in C# WinForms
INSERT INTO table with no Duplicates
Oracle Build Table of tables
textmode password
GUID of a ActiveX OCX
Netbackup 654 : How to import a non netbackup tape and read data from it
User has 6GB PST file (archive.pst), how do I break into smaller pieces?
How can I send HTML formatted emails to someone who signs up on my site
UI Design - How to mockup .net application?