|
hi
Just Elaborate ur requirement...
bye
Paritosh
|
|
|
|
|
microuser_2000 wrote: i wana Subtract values from current date
If you want to subtract from the current date then use DateTime.Add()[^] and supply a negative number.
microuser_2000 wrote: let say i wana subtract today value with 7days befor and so on
See also: DateTime.AddDays()[^]
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
the (-) method worked fine for me thxx ..
|
|
|
|
|
Hi everyone,
I am trying to change the color of form2 when i click the button in form1. Problem is that form2 and colordialogbox also displays but the form2 is not changed to the selected color from the color dialogbox. I dont know where am I going wrong.The code is as follows in form1
Button1_click.....
dim frm as new form2
frm.colordialog1.showdialog()
frm.forecolor=colordialog1.color
frm.showdialog()
end
Please help me
thanx in advance
|
|
|
|
|
frm2 = As New Form2()
frm2.BackColor = System.Drawing.Color.YellowGreen
frm2.Show()
|
|
|
|
|
If the color dialog in on form2, run it from form2.
Try not to modify forms from other forms! It's really considered bad practice.
' Form 1 Button click
Dim frm As New Form2
frm.ShowDialog()
' Form 2 Load event or Button Click on Form2
colorDialog1.ShowDialog()
Me.BackColor = colorDialog1.Color
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
need to synchronize data between our main Server and local Client Servers
both contain Patient Records, but the Local Client server contain only patient records related to that client
please give me the ways we can synchronize this data
and suggest a better solution of synchronization.
things to be considered
the synchronization process should be controller by the client application (or some front end)i.e. the synchronization should take place when the user wants it to be done and he should be able to pause or resume the synchronization optionally he may choose data for synchronization (i.e. he may not want few details that has bulk data to be synchronized)
Thanks & Regards
himagiri
|
|
|
|
|
himagiri wrote: suggest a better solution of synchronization.
SQL Server: Replication[^]
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
I have make a Project and start from Module -> sub main
I have two forms in this project.
The main form, I have a notify icon, and a button for hide the form.
In Sub Main,
<br />
frmMain.showdialog<br />
After the form is shown, I would like to click the button for hide this form by
<br />
me.hide()<br />
However, it just finish the application.
How can the button just Hide the form and the notify icon still here(that's the application still running)?
Thank you.
|
|
|
|
|
.
.
.
.
frmMain.showdialog
.
.
.
.
.
yourformname.hide
|
|
|
|
|
I would like to hide it by the button in the form,
but not in module.
Thank you anyway,
Does anyone can help ?
|
|
|
|
|
In the Click event of the button...
Me.Hide()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
As I descripte,
me.hide for the click event button will just close the application,
but not only hide the form.
|
|
|
|
|
.Hide() does just that, hides the form. It does NOT close it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
But I really get this problem,
actually, I think the main reason that close the application is the project start up from module.
when I create the form object and form.showdialog.
But after I hide the form, the procedure come back to the module and the project end.
How to get rid of this?
|
|
|
|
|
I don't understand what you're saying.
How about posting the code in your module that is starting this form?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I am new to this forum so please bear with me until I learn how things are done here.
I am trying to write a “VB-6” program where the user can click on a picture of a part and the program then opens an “Excel” price list for them. I used a transparent text box over the picture. You can start the program, click the picture, and an “Excel” window opens with the proper line highlighted. Then, if you close the “Excel” window and try to click on the picture again, the program balks. Part of the “Excel” window appears but it is empty. The program doesn’t crash. It just refuses to show the “Excel” sheet again.
This is the code that I used:
Dim AppExcel As Excel.Application
This sub sets the focus on the picture so the scroll bar doesn’t blink.
Private Sub Form_Activate()
p4l80e.SetFocus
End Sub
This sub tells the program to open “Excel”.
Private Sub Form_Load()
Set AppExcel = CreateObject("Excel.Application")
Workbooks.Open FileName:="D:\K and D (152598).xls"
End Sub
This sub makes “Excel” visible, finds the proper row, and highlights the entire row.
Private Sub lbl034_Click()
'On Error GoTo erh
AppExcel.Visible = True
Cells.Find(What:="34034b", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
'Highlights the entire row.
If IsEmpty(ActiveCell) Then Exit Sub
On Error Resume Next
If IsEmpty(ActiveCell.Offset(0, -1)) Then Set LeftCell = ActiveCell Else Set LeftCell = ActiveCell.End(xlToLeft)
If IsEmpty(ActiveCell.Offset(0, 1)) Then Set RightCell = ActiveCell Else Set RightCell = ActiveCell.End(xlToRight)
Range(LeftCell, RightCell).Select
Exit Sub
erh: MsgBox Error(Err)
End Sub
This is a different attempt at the above code with a different part number. It will work the first time around also. Second attempt, it also will not respond.
Private Sub lbl070_Click()
On Error GoTo erh
'Set AppExcel = CreateObject("Excel.Application")
Workbooks.Open FileName:="D:\K and D (152598).xls"
Cells.Find(What:="34070e", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
AppExcel.Visible = True
Exit Sub
erh: MsgBox Error(Err)
End Sub
The following code works fine. It just controls the scroll bar to move the picture of the parts to be selected.
Private Sub scr_Change()
On Error GoTo erh
p4l80e.Top = scr.Value
' p24L80E.Top = scr.Value + 12500
erh:
End Sub
Private Sub scr_Scroll()
Call scr_Change
p4l80e.SetFocus
End Sub
I am FAR from a pro. at this. I just taught myself from books that I bought so I might not understand a reply unless it’s kept pretty simple and straight forward.
Thanks in advance, Garner
|
|
|
|
|
hi,
just close the workbook and also quit the excel application before exiting the Sub routine.
Paritosh
|
|
|
|
|
Hi Paritosh,
I thought that this was the problem but I haven't figured out how to do it. If I use a "close" event in the sub that shows the "Excel" workbook, the workbook flashes on the screen and back off before you get to look at it. I tried to put it in my main form "activate" sub and that didn't work either. I need this to happen automaticly as the user closes the "Excel" window so they can just click on another part of the picture.
Could you give me an idea of what the code would look like and what sub to put it in? Like I said, I'm "self-taught" in "VB" so my teacher isn't the sharpest tool in the shed.
Thanks again, Garner
|
|
|
|
|
Hello, I have the following code:
<br />
excelApp = CreateObject("Excel.Application")<br />
excelWorkbook = excelApp.Workbooks.Open(Filename:=FILE, UpdateLinks:=False, ReadOnly:=False)<br />
<br />
With excelWorkbook.ActiveSheet<br />
<br />
For i As Integer = 0 To 5<br />
.Cells((i + 2), 1) = i<br />
.Cells((i + 2), 2) = i+1<br />
Next i<br />
<br />
End With<br />
<br />
excelWorkbook.Save()<br />
I want to be able to change the font/color of the text displayed in each cell, however I am not sure how to do so. Is there a way to do this? Please help.
Mike - I love to program!
|
|
|
|
|
hi,
Select the cell
cells(1,1).Select
selection.font.bold=true
Selection.Font.ColorIndex = 50
50 is the for green
bye.
Paritosh
|
|
|
|
|
That didn't work. I am using VB.Net and it does not recognize selection. I tried using the Excel.Application selection and applying your code, as well as Selection.Font.FontStyle = "Bold", but that did not work either. Is there something that I am missing?
I love to program!
|
|
|
|
|
try out this
cells(1,1).activate
activecell.font.color=10
activecell.font.bold=true
Paritosh
|
|
|
|
|
the code as you typed it there wouldn't compile, so I tried this:
.Cells(1,1).Activate()
excelApp.ActiveCell.Font.Bold = True
excelApp.ActiveCell.Color = 10
The code compiled and the program ran perfectly, however the font was not bold nor was the color changed when I opened the excel file. Does the fact that I'm using VB.Net change anything?
I love to program!
|
|
|
|
|
i am using VB 6.0.
so for vb .net some modification required..which you can do (I yhink)
anyway try this
dim wb as workbook
dim ws as worksheet
set wb=excelApp.workbooks.open("file name")
set ws=wb.sheets(1)
ws.cells(1,1).activate
ws.activecell.font.bold=true
ws.activecell.font.colorindex=10
bye.
Paritosh
|
|
|
|