|
Do you have a code sample or a screenshot? It might make it clearer of what you want to accomplish.
|
|
|
|
|
************Code******************
Public Function GetBoxName()
'This does ------
'Declare control variable
Dim ctl As Control, frm As Form
Dim name As String
'Set form equal to SQA Checklist. OTherwise if looking at active form an error
'will occur when debugging due to the debug window being active
Set frm = [Forms]![SQA Audit Checklist]
'Set control equal to the current box being edited
Set ctl = frm.ActiveControl
'Set current box name to "name" variable
name = ctl.name
Dim x As String
'Trim last 2 characters to use in SetHistory function
x = Right(name, 2)
End Function
Public Function SetHistory(x)
'This uses the 2 characters to set what name belongs w/ which history box
Dim user As String
user = CurrentUser
History = ("History" + x)
MsgBox (b)
End Function
Private Sub Answer01_AfterUpdate()
Call GetBoxName
Call SetHistory(x)
End Sub
*********Code End******************
I hope this makes sense. Thanks!
|
|
|
|
|
Help! I have been trying to solve these two problems that I have with my code.
1. Write code to select a drive letter highlighted in a listbox that can be added to a string. I can add to the string, but cannot make the command select the variable from the listbox.
2. Wait command with VB or Shell command. I have several programs that I need to run; One after another. The code I have will run these programs (.exe) files simultaneously and not wait until the first command is complete.
3. In addition, I do not know if this is possible, Norestart with shell command.
Here is some of my code...Please help.
Dim ProcId As Integer ' For Shell Comamnd
Dim drive_name As String ' For Drive Letter to be added to shell command
Private Sub Fx()
'drive_name = "" 'cboDrives.Name Needs help with code
If check1(0).Value = vbChecked Then 'Install DotNetFix
ProcId = Shell(drive_name & ":\\Update\\WindowsNeroUpdatefx.exe -q", vbNormalFocus)
End If
End Sub
Any help is greatly appreciated!
|
|
|
|
|
This should solve your first issue:
You cannot use .Name, this will return the Name property of your combo box. In your case, it will set drive_name = "cboDrives"
'drive_name = "" 'cboDrives.Name Needs help with code
Should be:
'get the current text displayed in the combo box<br />
drive_name = cboDrives.Text<br />
'OR<br />
drive_name = cboDrives.SelectedItem.ToString
|
|
|
|
|
Thanks! This is getting me closer to the final result!
cboDrives.text worked!
Thanks again.
|
|
|
|
|
Hi,
Can anyone tell me how to save flash files into database and retrieve them (plz send me the code if possible)
is there a way if yes plz tell me
thanks in advance
|
|
|
|
|
|
When closing a PrintPreviewDialog using the provided close button:
An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in system.windows.forms.dll
Additional information: External component has thrown an exception.
Program is MDI, the form calling the PrintPreviewDialog is child form.
Any Ideas?
|
|
|
|
|
HI
I have a datagrid connected to a 'Select query' in a Data-Environment.
In my application I am adding new records to a table (the table in the select query) and then updating my datagrid using refresh. But the new record does not appear in the datagrid.
How do I make the new record/s appear ?
Can somebody please help me ?
- Lostris
|
|
|
|
|
I need to create editable form when a row of selected items is selected.
For example:
Private Sub flex_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles flex.Click
Dim objRow As Integer = flex.MouseRow
flex.Rows(objRow).Selected = True
'MessageBox.Show(objRow)
End Sub
objRow contains the value of the row that is clicked however now how should I get the values of that given row and then
pass them to the form.
Thank you for any ideas.
matt
|
|
|
|
|
nodx=Treeview1.Nodes.Add("key","Text")
How to get the "key" ?
Thanks!
vs.net 2005 beta 2
|
|
|
|
|
|
I wanna study Windows API,but i don't know how and where do i start......somebody give me some advice......thanks......
i like pRograM......
|
|
|
|
|
|
Sometimes Visual Studio REALLY frustrates me. I've got a problem that just started occurring in the last day or so and I have no idea why, nor do I know how to fix it. This is the error I'm getting:
An exception occurred while trying to create an instance of ECM.frmStdMdiChild. The exception was "Object reference not set to an instance of an object.".
frmStdMdiChild is a class that inherits from System.Windows.Forms.Form. All of the children forms in the project are of this type. I needed to expand upon the properties provided in the standard Form.
What's confusing is that if I look at the forms that it is complaining about, the only reference to frmStdMdiChild is in the Inherits line. The program compiles and runs fine. No problems that I can see. However, I cannot pull up the form designer on any of the children forms. It just gives me a screen with a red X, displays the message shown above, and tells me that has to be fixed before I can use the designer.
I have tried commenting out almost everything in the child form (including all of the "Windows Form Designer generated code" section, commented everything out in the frmStdMdiChild, and even tried changing the Inherits on the child form back to System.Windows.Forms.Form. All to no avail. At this point I am very much open to suggestions.
--In a world without fences, who needs Gates?
|
|
|
|
|
Hello. I have a datagrid with a dataset as datasource. I have a problem when I am trying sort the datagrid. I want sort the dataset at the same time for to know where the row clicked of the datagrid is in the dataset.
waiting help...
Thanks
|
|
|
|
|
Hi folks, I need your help!
I'm using VB to make some programming. Right now my project has a bunch of forms and my database got corrupted, so I almost lost my code.
The thing is I need a macro or similar way to 'EXPORT' my code (in VB's .cls format) when I start coding. And I want it for every form of the project (that's way I wanted the automation). Just in case I need it later (kind of backup).
Is it such a way?
Thanks in advance!
|
|
|
|
|
Just copy the files. They're all just text files, so I don't see what the problem is?
How does this database being corrupted figure into this?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is this a VBA in MS Access sort of thing?
Jon
|
|
|
|
|
Right to the point. It's a VBA in Access.
I could copy the files (of course they're just text) but I've got quite a lot of file and it would a pain to copy all of them manually. So I want some kind of macro to automate the proccess!
Thanks.
|
|
|
|
|
Well, as nobody could help me, here's the answer I found by myself.
Just use this:
For i = 1 To Application.VBE.ActiveVBProject.VBComponents.Count
Application.VBE.ActiveVBProject.VBComponents(i).Export "file" & i & ".txt"
next i
This way all forms, modules, classes, etc. are saved on the local path in plain text format.
Sweet and easy, uh?
Hope it helps out there!
|
|
|
|
|
In order to avoid a null DateTime field in my ACCESS database table, how do I fill it with an 'empty' Date or DateTime string?
Thank you for your help in advance.
|
|
|
|
|
There's no such thing as an "Empty" date/time field in Access. It either has a valid date/time in it or it's Null. Since your database is doesn't allow Nulls, the only recourse you have is to put in a known bogus, but valid, date/time, such as Jan 1, 1970.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I could not delete the rows
using the delete key.
I can delete the rows in other way
but I prees the delete key in datagrid
nothing to happen
property Readonly = True
KeyDown
KeyPress
KeyUP
this keys are not working in datagrid
OS : XP
visualstudio: 2003
VB.net
Continue...
|
|
|
|
|
I may be wrong, but if you are setting the property Readonly = True, than you shouldn't be able to change the data.
Perhaps a code sample or more detail of what you are trying to do?
|
|
|
|