|
Thank man , i want to Validate based on this Format dd/mm/yyyy
After a Person put lets say for Example
12042007
it must convert it to
12/04/2007
if not it must
msgbox "Enter Date in dd/mm/yyyy
and it must allow the person to enter "/" to separate the month and days and years
Vuyiswa
|
|
|
|
|
Add the framework class
Imports Microsoft.VisualBasic.Compatibility.VB6.Support
Then
use the format function
like
if(isdate(textbox1.text)=true)then
Format(textboxt1.text,"dd-mm-yyyy")
end sub
Hope this may help u
|
|
|
|
|
Private Sub Command1_Click()
On Error Resume Next
Dim Temp As String
If Len(Text1) = 8 Then
Temp = Mid(Text1, 1, 2) & "/" & Mid(Text1, 3, 2) & "/" & Mid(Text1, 5, 4)
If CDate(Temp) > Now Then
MsgBox "Invalid Date"
Else
MsgBox CDate(Temp)
End If
End If
If Len(Text1) = 10 Then
If CDate(Text1) > Now Then
MsgBox "Invalid Date"
Else
MsgBox CDate(Text1)
End If
End If
End Sub
Private Sub Form_Load()
Text1.MaxLength = 10
End Sub
Try this... hope it helps..
|
|
|
|
|
Thank you very much man , this has Helped a lot . thanks you
Vuyiswa
|
|
|
|
|
Hello Frnds,
I am using VB.Net 2.0. i have to read a word document
pagewise
Is It possible.....????
If yes then plzzz tell me ...how can I???
The version of the office is 2000
Please Help....
Thankx in Advance
- Koolprasad2006
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
friend..
im a vb user..i didnt get you exactly..
do u want to read the whole document from a form itself..??
or do u want to open up the word file from any event??
plz make it clear..
|
|
|
|
|
Hello frnd Xandip,
i just want to open a word file by program and read the content of the file page by page (pagewise)
Plezzz..Help Me
Thankx in Advance
-koolprasad2006
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
dear prasad..
i think this is wht u want...
add the OLE component from the toolbox in to the form. it will ask you the object type. select the Microsoft Word Document from the list...
Private Sub Command1_Click()
OLE1.SourceDoc = "Complete path of your word file"
OLE1.Action = 1
OLE1.SetFocus
SendKeys "{ENTER}"
End Sub
try this...
|
|
|
|
|
koolprasad2003 wrote: i have to read a word document
So what does this really mean?? Are you trying to show/edit a word document in your form? Are you trying to get the contents of the document and store or process it in your app? What are you dogin with this document?? And DON'T say "I'm just trying to read it!".
|
|
|
|
|
Hi,
how to set two different language for 2 different textboxs in VB.net 2.0.
I have 2 Textboxes one in English and one in Marathi on a form.On start of my application marathi language must be set. For this purpose ,I write following code in form load event :
InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(New System.Globalization.CultureInfo("mr-IN")
Thanks
vandana
|
|
|
|
|
You may want to take a look at this[^].
|
|
|
|
|
Hello Frnds,
I am using VB.Net 2.0 and my problem is
I want to disable the Ctrl+P key(Shortcut to Print page) combination as soon as my page is load
i have to disable the print facility by disableing the ctrl+P combination.
The combination is disable upto the page is unloaded.
Plzzzzzzzzz....HELP
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
Write the code on keypress and return the handle value equals to true
|
|
|
|
|
First ofall thank U Nilesh 4 your great co-operation
but can u code a small code sample ...PLZZZZ
i didn't clear your point so much....
PLZZZZZZ..help
thankx in advance
-Koolprasad2006
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
hi buddy..
wat prasad said is correct.. i don know vb.net, but im sending the vb code for this.. try it out..
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 16 Then Exit Sub
End Sub
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
The keyascii for CTRL+P combination is 16.. got it??
|
|
|
|
|
This doesn't make any sense. You say you want to disable the Ctrl-P keys in your application, but if you don't provide the shortcut in your app yourself, Ctrl-P won't do anything anyway??
Wait a minute....Is this a Web Application (ASP.NET)??
|
|
|
|
|
am using vb6, am trying to add this Filed from a textbox, to the Extension filed in my database and when i try to Execute my Code it highlight this line and here is my whole code for that save button
It will higlight the Extension line
Private Sub cmdAdd_Click()
rrs("Num_key") = txtnumkey
rrs("EXTENSION") = txtextension
rrs("Actual_Extent") = txtactualextent
rrs("Lis_key") = txtliskey
rrs("Func_Key") = txtfunckey
rrs("Prop_Category_ID") = txtcategory
rrs("GEOCODE") = txtgeocode
rrs("Add_Date") = txtadddate
rrs("Add_user_ID") = txtadduserid
rrs.Update
cmdNew.Visible = True
cmdUpdate.Visible = True
cmdRefresh.Visible = True
cmdDelete.Visible = True
End Sub
Please Help
Vuyiswa
|
|
|
|
|
|
The Extension fiels is
"int" and it allow Null values, infect all the fields i have allow null values, and i have droped a textbox in my form and name it txtextension, i have checked it matched with the one in my code,i have bind it, i can scroll with recordset. but when i try to insert it gives me Problem, as the Filed Extension allows Null values ,If i dot enter anything it supposed to continue. Here is my code for all Buttons
*************************************
This is My Connection
*************************************
Set conn = New Connection
Set rrs = New Recordset
rrs.CursorLocation = adUseServer
rrs.CursorType = adOpenDynamic
rrs.LockType = adLockOptimistic
With conn
.Provider = "SQLOLEDB"
.ConnectionString = "User ID =sde;Password=topology;" & _
"Data Source =SGIICORNETGS01;" & _
"Initial Catalog = Tshwane_Valuations"
.Open
End With
rrs.Open "select * from Property", conn
'Numkey
Set txtnumkey.DataSource = rrs
txtnumkey.DataField = "Num_key"
'Extension
Set txtextension.DataSource = rrs
txtextension.DataField = "Extension"
'Cell ID
Set txtcellid.DataSource = rrs
txtcellid.DataField = "Cell_ID"
'Actula Extent
Set txtactualextent.DataSource = rrs
txtactualextent.DataField = "ACTUAL_EXTENT"
'liskey
Set txtliskey.DataSource = rrs
txtliskey.DataField = "Lis_key"
'set txtfunckey
Set txtfunckey.DataSource = rrs
txtfunckey.DataField = "func_key"
'txtcategory
Set txtcategory.DataSource = rrs
txtcategory.DataField = "PROP_CATEGORY_ID"
'Geocode
Set txtgeocode.DataSource = rrs
txtgeocode.DataField = "GEOCODE"
'Add Date
Set txtadddate.DataSource = rrs
txtadddate.DataField = "ADD_DATE"
'User ID
Set txtadduserid.DataSource = rrs
txtadduserid.DataField = "ADD_USER_ID"
End Sub
********************************************************
Edit /Update
*********************************************************
Private Sub cmdUpdate_Click()
rrs.Update
rrs.MoveNext
If rrs.EOF = True Then
rrs.MoveLast
End If
End Sub
**********************************
and the rest
*********************************
Private Sub cmdAdd_Click()
rrs("Num_key") = txtnumkey
rrs("EXTENSION") = txtextension
rrs("Actual_Extent") = txtactualextent
rrs("Lis_key") = txtliskey
rrs("Func_Key") = txtfunckey
rrs("Prop_Category_ID") = txtcategory
rrs("GEOCODE") = txtgeocode
rrs("Add_Date") = txtadddate
rrs("Add_user_ID") = txtadduserid
rrs.Update
cmdNew.Visible = True
cmdUpdate.Visible = True
cmdRefresh.Visible = True
cmdDelete.Visible = True
End Sub
Private Sub cmdCancel_Click()
rrs.Cancel
End Sub
Private Sub cmdClose_Click()
Dim intresponse As Integer
intresponse = MsgBox("Do you want to Exit", vbYesNo, "Warning")
If intresponse = vbYes Then
Unload Me
ElseIf intresponse = vbNo Then
frmSingle2.Show
End If
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
With rrs
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
Private Sub cmdFirst_Click()
rrs.MoveFirst
End Sub
Private Sub cmdLast_Click()
rrs.MoveLast
End Sub
Private Sub cmdNew_Click()
txtnumkey.Text = ""
txtextension.Text = ""
txtextension.Text = ""
txtcellid.Text = ""
txtcellid.Text = ""
txtactualextent.Text = ""
txtactualextent.Text = ""
txtliskey.Text = ""
txtliskey.Text = ""
txtfunckey.Text = ""
txtfunckey.Text = ""
txtcategory.Text = ""
txtgeocode.Text = ""
txtadddate.Text = ""
txtadduserid.Text = ""
cmdNew.Visible = False
cmdUpdate.Visible = False
cmdRefresh.Visible = False
cmdDelete.Visible = False
End Sub
Private Sub cmdNext_Click()
If rrs.EOF = True Then
rrs.MoveLast
Else
rrs.MoveNext
End If
End Sub
Private Sub cmdPrevious_Click()
rrs.MovePrevious
If rrs.BOF = True Then
rrs.MoveFirst
End If
End Sub
Private Sub cmdRefresh_Click()
rrs.Requery
End Sub
Private Sub cmdAdd_Click()
rrs("Num_key") = txtnumkey
rrs("EXTENSION") = txtextension
rrs("Actual_Extent") = txtactualextent
rrs("Lis_key") = txtliskey
rrs("Func_Key") = txtfunckey
rrs("Prop_Category_ID") = txtcategory
rrs("GEOCODE") = txtgeocode
rrs("Add_Date") = txtadddate
rrs("Add_user_ID") = txtadduserid
rrs.Update
cmdNew.Visible = True
cmdUpdate.Visible = True
cmdRefresh.Visible = True
cmdDelete.Visible = True
End Sub
Private Sub cmdCancel_Click()
rrs.Cancel
End Sub
Private Sub cmdClose_Click()
Dim intresponse As Integer
intresponse = MsgBox("Do you want to Exit", vbYesNo, "Warning")
If intresponse = vbYes Then
Unload Me
ElseIf intresponse = vbNo Then
frmSingle2.Show
End If
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
With rrs
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
Private Sub cmdFirst_Click()
rrs.MoveFirst
End Sub
Private Sub cmdLast_Click()
rrs.MoveLast
End Sub
Private Sub cmdNew_Click()
txtnumkey.Text = ""
txtextension.Text = ""
txtextension.Text = ""
txtcellid.Text = ""
txtcellid.Text = ""
txtactualextent.Text = ""
txtactualextent.Text = ""
txtliskey.Text = ""
txtliskey.Text = ""
txtfunckey.Text = ""
txtfunckey.Text = ""
txtcategory.Text = ""
txtgeocode.Text = ""
txtadddate.Text = ""
txtadduserid.Text = ""
cmdNew.Visible = False
cmdUpdate.Visible = False
cmdRefresh.Visible = False
cmdDelete.Visible = False
End Sub
Private Sub cmdNext_Click()
If rrs.EOF = True Then
rrs.MoveLast
Else
rrs.MoveNext
End If
End Sub
Private Sub cmdPrevious_Click()
rrs.MovePrevious
If rrs.BOF = True Then
rrs.MoveFirst
End If
End Sub
Private Sub cmdRefresh_Click()
rrs.Requery
End Sub
Please help
Vuyiswa
|
|
|
|
|
A text box contains text - if you enter numbers in it and assign to a numeric field, VB will do an automatic conversion, but what happens if the text contains characters other than numbers? Converting the text to value is always a good idea when assigning to number type fields.
And an empty string is not a null value...
Hope this helps
|
|
|
|
|
Meaning that my code is correct i just need to make some conversions.?and please can you pleae comment on myConnection and my indivisual buttons , where should i improve and what is safe. Advice.
Thanks Man
Vuyiswa
|
|
|
|
|
i have managed to add data and save it, but whe i click on cmdPrevious
it show me this Error
"Row handles must all be relaeased before new ones can be obtained" hence this is a big database , did it save the record? and why that Error.
The code for First and Previous
Private Sub cmdPrevious_Click()
rrs.MovePrevious
If rrs.BOF = True Then
rrs.MoveFirst
End If
End Sub
Private Sub cmdFirst_Click()
rrs.MoveFirst
End Sub
and i get an Error when i try to Delete
"Either BOE or EOF is true or the Current Record has been Deleted Request Operation Requires Current record."
What suprises me is that i was scrolling through the recordset and i came across the blank record, so i was trying to delete it.Below is the code for delete
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
With rrs
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
Thank once more
Vuyiswa
|
|
|
|
|
hi,
i want to set the icon of my exe but a error arise for a particular image . Error is below
Error 1 Unable to write to output file 'C:\Documents and Settings\admin\Desktop\WindowsApplication1\WindowsApplication1\obj\Debug\WindowsApplication1.exe': The specified image file did not contain a resource section.
when i use favorites.ico file then above error occured but if i replace this icon file to other icon file then my application is running successfully. i have no idea about this error
thanks in advance
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
the file you are choosing, may be corrupted or some sort of fragmentation must have occurred...
|
|
|
|
|
The icon file isn't valid. There are a couple of applications out there that do NOT generate the proper format for an .ICO file, though, I can't remember what they are. This problem has come up before. The users ended up using a different package to create their icons.
|
|
|
|