473,811 Members | 3,300 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

double click..

Pam

When I double click on a event in a form I want it to
bring up another form and load the same data so it can be
edited.

I'm having a hard time doing this. The new form loads;but
my file can't be found. Can you can me some ideas on how
to do this.

Please help!!
Nov 20 '05 #1
7 2671
Hi Pam,

You're not telling us much. :-(

What data? What file?

Can you show us what you're doing and tell us what does/doesn't happen?

Regards,
Fergus
Nov 20 '05 #2
Hello,

"Pam" <pa************ @yahoo.com> schrieb:
When I double click on a event in a form I want it to
bring up another form and load the same data so it can be
edited.

I'm having a hard time doing this. The new form loads;but
my file can't be found. Can you can me some ideas on how
to do this.


What file? Please post some code.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3
Pam
Below is a small sample of the code that loads the first
form. Once I double click on the edit part I want it to
call another form (that I have already created) and load
the event data of the same scenario that was on this first
form.
Pam
Public Function LoadScenarioFor Edit(ScenarioNa me As
String) As Boolean
Dim filenum As Integer, strData As String, dlim As
String * 1, i As Integer
LoadScenarioFor Edit = True
Me.Tag = ScenarioName
Me.Caption = ScenarioName & " - Scenario Editor"
ScenarioInfoFil e = ROOT_DIR & WORK_DIR & ScenarioName
& "." & ScenarioInfo_EX T
ScenarioEventFi le = ROOT_DIR & WORK_DIR & ScenarioName
& "." & ScenarioEvent_E XT
'Load scenario information file
filenum = FreeFile
On Error Resume Next
Open ScenarioInfoFil e For Input As #filenum
Line Input #filenum, strData
Close #filenum
If InStr(strData, vbTab) = 0 Then 'Tab delimiter
not found
If InStr(strData, ";") <> 0 Then
dlim = ";"
End If
If InStr(strData, ",") <> 0 Then
dlim = ","
End If
If dlim = " " Then 'Unable to determine data
delimiter
MsgBox "No valid data delimiter for file "
& filename, vbCritical
Else 'Convert delimiter to tab
Do
i = InStr(strData, dlim)
strData = Left(strData, i - 1) & vbTab &
Right(strData, Len(strData) - i)
Loop While InStr(strData, dlim) > 0
End If
End If
With dgdScenarioInfo
.AddItem strData
txtName.Text = .TextMatrix(0, 0)
txtVersion.Text = .TextMatrix(0, 1)
txtModDate.Text = .TextMatrix(0, 2)
txtHours.Text = .TextMatrix(0, 5)
txtRate.Text = .TextMatrix(0, 3)
lblRunTimeValue .Caption = .TextMatrix(0, 4)
lblSEvalue.Capt ion = .TextMatrix(0, 6)
lblEIvalue.Capt ion = .TextMatrix(0, 7)
lblREvalue.Capt ion = .TextMatrix(0, 8)
txtComment.Text = .TextMatrix(0, 9)
End With
End If
'Load scenario event file
dlim = " "
filenum = FreeFile
On Error Resume Next
Open ScenarioEventFi le For Input As #filenum
If Err.Number <> 0 Then
strData = "Error opening file " &
ScenarioEventFi le & " Error: " & Err.Number & " " &
Err.Description
WriteLog strData
MsgBox strData, vbCritical, "Edit scenario " &
ScenarioName
LoadScenarioFor Edit = False
Exit Function
Else
Line Input #filenum, strData
If InStr(strData, vbTab) = 0 Then 'Tab delimiter
not found
If InStr(strData, ";") <> 0 Then dlim = ";"
If InStr(strData, ",") <> 0 Then dlim = ","
If dlim = " " Then 'Unable to determine data
delimiter
MsgBox "Unable to determine file delimiter
for file " & filename, vbCritical
Else 'Convert delimiter to tab
Do
i = InStr(strData, dlim)
strData = Left(strData, i - 1) & vbTab &
Right(strData, Len(strData) - i)
Loop While InStr(strData, dlim) > 0
End If
-----Original Message-----
Hi Pam,

You're not telling us much. :-(

What data? What file?

Can you show us what you're doing and tell us what does/doesn't happen?
Regards,
Fergus
.

Nov 20 '05 #4
Pam
Below is a small sample of the code that loads the first
form. Once I double click on the edit part I want it to
call another form (that I have already created) and load
the event data of the same scenario that was on this first
form.
Pam
Public Function LoadScenarioFor Edit(ScenarioNa me As
String) As Boolean
Dim filenum As Integer, strData As String, dlim As
String * 1, i As Integer
LoadScenarioFor Edit = True
Me.Tag = ScenarioName
Me.Caption = ScenarioName & " - Scenario Editor"
ScenarioInfoFil e = ROOT_DIR & WORK_DIR & ScenarioName
& "." & ScenarioInfo_EX T
ScenarioEventFi le = ROOT_DIR & WORK_DIR & ScenarioName
& "." & ScenarioEvent_E XT
'Load scenario information file
filenum = FreeFile
On Error Resume Next
Open ScenarioInfoFil e For Input As #filenum
Line Input #filenum, strData
Close #filenum
If InStr(strData, vbTab) = 0 Then 'Tab delimiter
not found
If InStr(strData, ";") <> 0 Then
dlim = ";"
End If
If InStr(strData, ",") <> 0 Then
dlim = ","
End If
If dlim = " " Then 'Unable to determine data
delimiter
MsgBox "No valid data delimiter for file "
& filename, vbCritical
Else 'Convert delimiter to tab
Do
i = InStr(strData, dlim)
strData = Left(strData, i - 1) & vbTab &
Right(strData, Len(strData) - i)
Loop While InStr(strData, dlim) > 0
End If
End If
With dgdScenarioInfo
.AddItem strData
txtName.Text = .TextMatrix(0, 0)
txtVersion.Text = .TextMatrix(0, 1)
txtModDate.Text = .TextMatrix(0, 2)
txtHours.Text = .TextMatrix(0, 5)
txtRate.Text = .TextMatrix(0, 3)
lblRunTimeValue .Caption = .TextMatrix(0, 4)
lblSEvalue.Capt ion = .TextMatrix(0, 6)
lblEIvalue.Capt ion = .TextMatrix(0, 7)
lblREvalue.Capt ion = .TextMatrix(0, 8)
txtComment.Text = .TextMatrix(0, 9)
End With
End If
'Load scenario event file
dlim = " "
filenum = FreeFile
On Error Resume Next
Open ScenarioEventFi le For Input As #filenum
If Err.Number <> 0 Then
strData = "Error opening file " &
ScenarioEventFi le & " Error: " & Err.Number & " " &
Err.Description
WriteLog strData
MsgBox strData, vbCritical, "Edit scenario " &
ScenarioName
LoadScenarioFor Edit = False
Exit Function
Else
Line Input #filenum, strData
If InStr(strData, vbTab) = 0 Then 'Tab delimiter
not found
If InStr(strData, ";") <> 0 Then dlim = ";"
If InStr(strData, ",") <> 0 Then dlim = ","
If dlim = " " Then 'Unable to determine data
delimiter
MsgBox "Unable to determine file delimiter
for file " & filename, vbCritical
Else 'Convert delimiter to tab
Do
i = InStr(strData, dlim)
strData = Left(strData, i - 1) & vbTab &
Right(strData, Len(strData) - i)
Loop While InStr(strData, dlim) > 0
End If
-----Original Message-----
Hello,

"Pam" <pa************ @yahoo.com> schrieb:
When I double click on a event in a form I want it to
bring up another form and load the same data so it can be edited.

I'm having a hard time doing this. The new form loads;but my file can't be found. Can you can me some ideas on how to do this.


What file? Please post some code.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
.

Nov 20 '05 #5
Hi Pam,

So what's actually going wrong. What's stopping you do the same thing on
the second form?

Is there something wrong in the code that you gave us? If so, any clues?
If not, what is it supposed to show us?

In other words - Please spell out the problem as if I'm an idiot. ;-)

Regards,
Fergus
Nov 20 '05 #6
pam
The problem in the second is isn't putting the data in the
form. I get an error saying file not found. It's not
passing the ScenarioName to the dblclick subrountine.
-----Original Message-----
Hi Pam,

So what's actually going wrong. What's stopping you do the same thing onthe second form?

Is there something wrong in the code that you gave us? If so, any clues?If not, what is it supposed to show us?

In other words - Please spell out the problem as if I'm an idiot. ;-)
Regards,
Fergus
.

Nov 20 '05 #7
"Pam" <pa************ @yahoo.com> schrieb
Below is a small sample of the code that loads the first


Thanks for posting it twice in the same thread. :)

SCNR
--
Armin

Nov 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
15648
by: Richard A. Lowe | last post by:
I'm using P/Invoke to call SendInput (using code culled from these newsgroups!) to send mouse events to a window. But I'm unsure how to send double-clicks. A VB6 article I saw on SendInput suggested simply queueing two click events, but this is not working for me, regardless of the delay I put between clicks. So give this as a click (where INPUT is an appropriate structure for sending the SendInput data): public static void Click()
3
4390
by: Wajih-ur-Rehman | last post by:
I am developing a C# app. I want to do something when someone double clicks on a combo box. But this event never fires. Any suggestions? Thanx!
4
3858
by: perspolis | last post by:
hi I manage a double click event in a combo box.. but this event doesn't fire ???? I don't know why??
1
4974
by: Lalit Bhatia | last post by:
Hi when focus is on a cell in datagrid. double click event does not occur. when I double click on rowheader, columnheader then this event fires. I am using DataGridTableStyle in the grid. -- Regards, Lalit Bhatia
3
2961
by: Siv | last post by:
Hi, I have a ListView control in a Windows application, currently single clicking a customer name in this list, selects the customer and displays their details in text boxes to the right of the list. The user must then click a button to select that customer and move off the page to the main database details. I would like to implement being able to double-click the listview item and it have the same effect as single clicking and then...
5
4748
by: Nick | last post by:
Hey guys, I have 2 events on a windows forms datagrid, the mouse move as well as the double click events. What's happening is that when I double click on a row in the grid, the mouse move event gets triggered and the double click is not identified at all. Is there any way I can invoke the double click when the mouse move also exists?
1
5428
by: scott_gui | last post by:
Creating a Windows application: <Double-Button-1> mouse event has a conflict when there is also a binding to the <Button-1> event. It seems like a silly oversight that performing a double click will also initiate the single click action. Has anyone figured out a way to circumvent this problem? Right now I am making the Double click function undo the action my Single click function does, but this is very annoying, especially since the...
2
4412
by: scott_gui | last post by:
I am creating a Windows application: The mouse event <Double-Button-1> has a conflict when the <Button-1> event also has a binding. Double clicks will first perform the single click action. This seems a little silly. Anyone know how to circumvent this? Right now I am having the function that is bound to the double click event undo the action the single click event performs. This is annoying and it flashes the single click event for a...
9
8061
by: Armando | last post by:
I have an app (A2000) where I am letting the user move an object on the screen. I use the OnClick for a command button event to modify the object's Top (or Left) properties, but you can only click slowly. That is, every other click is ignored, because Access is seeing a double click event. I would put the same code there, except I'm also using the SHIFT key (during mouse click) to cause bigger moves, and there's no SHIFT flag for the...
6
3205
by: Jim Devenish | last post by:
I have an unbound form that displays all the days of the year as a calendar. It has 12 rows of text boxes with either 29,30 or 31 in each row. Text box names are of the form: display_01_01, display_01_02 ... display_12_31. This is used to display bookings of holiday properties and works well. I am now wishing to be able to highlight a range of dates by double clicking in one text box and then in another, highlighting all the dates...
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10652
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10395
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10408
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10137
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9211
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7673
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5700
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4346
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.