Text Box Shows Number
hope you understand this i need some coding.......
If i type a number from 0-82 in text1 i want text2 to show the number 1 if i type a number between 83-174 i want text2 to show the number 2 if i type a number between 175-276 i want text2 to show number 3
this seems like really simple coding but i am a noob to vb i am just messing with it thats how i learn
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Err.Number Shows 0
I have the following code that, on an error, writes to a DB.
The problem is, when I get the first error in the select case,
run-time error 76 - Path not found
my error reporting doesn't show Err.Number as 76 but 0
Also Err.Description is empty as well.
Am I missing something obvious here?
vb Code:
Private Sub mnuHelpBackup_Click()On Error GoTo ErrTrap Dim BackupDestination As String 'get backup destination from registry (Options form)BackupDestination = GetRegistryStr(hkeyCurrent_User, strSubKey, "BackUpPath") 'copyfile actual fileFileCopy App.Path & "CLDB.mdb", BackupDestination & "CLDB.mdb" Exit Sub ErrTrap: Select Case Err.Number Case Is = 76 'path not found - possible folder deleted or moved MsgBox "The selected path does not exist. It may have been " & vbCrLf & _ "moved or deleted. Please select a new path.", vbOKOnly + vbInformation, _ "Path does not exist" Case Is = 4004 'Backup failed MsgBox Err.Description & vbCrLf & "Error number " & Err.Number, _ vbOKOnly + vbInformation, "Backup Error" Case Else MsgBox "Database cannot be copied." & vbCrLf & "Error Number = " & Err.Number & vbCrLf & _ "Error Description = " & Err.Description, vbOKOnly + vbInformation, "Backup Error"End Select ProcedureName = "frmCodeLib mnuHelpBackup"Call ErrorControl(strUser, Err.Number, Err.Description, ProcedureName, _ Format(Now, "dd/mm/yyyy"), Format(Now, "hh:mm:ss"))
EDIT
When run in the VB IDE this works, but when I compile the program, I get the problem explained above.
Only The Last Line Of Text Shows In My TextBox
output.Text = "Rc = " & Round(rc, 3) & " ohms"
this is an example from my program. I think that there is supposed to be a "go to next line" character because the computer is displaying each new line on top of the old lines even though MultiLine is set as true.
any help would be appreciated and thank you,
Ryan
Combo Select Shows Text Box
How do i write the following in vb?...
If i have a combo box called cbo_NoOfPieces. The numbers 1 to 10 are displayed inside the combo box. When the user clicks number 2 then i want to display 2 text boxes.
If the user selects 3 from the combo box i need to display 3 text boxes. and so on...
any ideas?
ta
Shows Different Table's Field In The Text Box...?
Hi, all...
I'm using VB 6.0 and MS Access 2002.
As a newbie, I made a simple program. I have a simple data file named 'project1' which has 3 tables - item, category, and project. Basically, item table has a field 'projectID', 'categoryId', and id field. Category table has two fields - also id and category which is a text. Project table also has two fields - id and project
Here is my problem. At my main form, I have one data control with item table and 2 text boxes. I want to show category (name, not id) in the text box. When I tried, text boxes always have number not name. I guess that it's because datafiled are all set to id field of Item table. So, I put two more data control and set two different tables and assigned Category and project (rather than id) to datafield of each text box. However, when I go through the main item's data, two text boxes don't change/show the correct value. How can I fix this...?
Thanks in advance,
Shin,
Newbie, Adding A Return To Code So Shows Up As A Return In A Text Box
i want to add code to lets say a command button so that when i click it certain text appears in my text box. ok i got that. but now i want to add code so that when i want i can just add to the
txtMessage.text = XXX.text & "RETURN KEY HERE!!!" & XXX.text
and in the RETURN KEY HERE!!! having it display the text inserted in code with the return key when command button is clicked.
yes i know stupid question but i want to know
Change A Labels Number Regarding Text File Number
i was wondering how i can change a labels caption number regarding what number is in a file
i have a file with 10 numbers on one line (ie.0123456789) and i have 10 labels
label 1 to 10 from left to right, now i need these to change accordingly (ie label1.caption = character 1 (0), label2.caption = charater 2 (1) and so on)
can this be done
if so how please
thankyou
Text File: Need To Capture Particular Number From Text
Hey everyone,
Thanx for having some interest. My problem is that I need to get some particular data from a text and save it into my project using VB6.
Here is what I have. It only works sometime. Does anyone know a better and more cleaner way to do this.
code:
--------------------------------------------------------
Dim a As String, b As String, c As String, d As String
Dim l As Single, m As Single, n As Single, o As Single
Dim strFile As String
strFile = "C: empFolder est.text"
Open strFile For Input As #1
Input #1, a
Input #1, b
Input #1, c
Input #1, d
Close #1
l = Right(a, 5)
m = Right(b, 5)
n = Right(c, 5)
o = Right(d, 5)
-----------------------
End of Code:
Beginning of Text file
--------------------
Thin Edge Minimum Value: 0.001
Thin Edge Maximum value: 0.75
Thick Edge Minimum value: 0.002
Thick Edge Maximum value: 0.94
---------------------------
End of text file
so what I need the program to do is store the value into a type single variable.
l = 0.001
m = 0.75
n = 0.002
o = 0.94
My code works sometime, but not all the time.
Q-man
Text Only And Number Only Text Boxes
i am trying to make some text boxes so only numbers/letters can be entered and if incorrect item is inserted a msgbox comes up.
could somone help me do this please
Grid Shows B-A Instead Of A-B
Hi, All!
My grid is showing the last item in the array first instead of the first item. Tried looking for a Sort property for the grid (MSHFlexGrid), but there isn't one. Don't know where else to look.
Below is the code.
Any help would be appreciated!
Thanks in advance,
vbprogwb (Bob)
'ReDimming the array
'As names and etc., are added to the Little Black Book
ReDim BlackBook_RecArray(totalRecs)
RecCount = totalRecs
Grid1.Col = 1
Grid1.Row = 1
'This fills up the array with Type - udtItemRec/itemStruc
For X = 1 To RecCount
Get #1, X, udtItemRec
BlackBook_RecArray(I) = udtItemRec.strLName & Chr(9) & udtItemRec.strFName & Chr(9) & udtItemRec.strPhone & Chr(9) & udtItemRec.strEmail
I = I + 1
Debug.Print BlackBook_RecArray(I) 'x = x + 1
Next X
I = 0
For I = 0 To RecCount - 1
If I <> RecCount Then
Debug.Print BlackBook_RecArray(I)
Grid1.AddItem (BlackBook_RecArray(I)), 1
End If
Next I
BitBlt (nothing Shows Up)
Hi, I want my pic1 picturebox to show up somewhere on top of the screen (which displays over EVERYTHING). My project file is attached. I have been trying to figure this one out for some time now.
Thanks in advance.
Vb Shows 2 Forms Instead One
i made something like de MDI sample from the VB help.when i reference the first element of the array(an array of forms),Vb loads 2 forms.And the UBound() of the array shows that is only one element in the array.
That'is when i reference array(0),Vb shows 2 forms and UBound(array)=0.any idea?
thanks
Listbox Shows Twice The Same Value
Hi, I was just wondering how do you do this:?
Add something to the listbox but if the value I added is already in there, then it does not come up again. For example, If I add the Name "George" to the listbox and try to add it again, the name "George" should not come up again since its already in there.
How can I do this with the IF....THEN statement?
Thank You,
EnYcE
Number To Text
i have a table of data in excel that i wrote from an SQL query. How can i change the column "a" data to be text instead of numbers?
Number To Text
ok here is what i need to do.. I need to take a number in hex formate and convert it into a text representation of it's binary value in 1's and 0's like the number &H02 would be "00000010"
I am creating a port program that works with the parralell port
the value's I send and recieve are in hexadecimal formate I want to convert them into a bianary string so that I can tell wich individual pins are on and wich are off I figured if i were able to convert it to text i could use the string function to check each space in the string to see if it were a 1 or 0 on/off
How To +1 To A Text Box Number?
Hello, I'm trying to teach myself some more VB at home and wanted to have a better understanding about adding numbers in the program. I'm going through some tutorials but I would learn a lot better from doing it myself.
On this code I did I have no idea how to add +1 to Interger level each time it's clicked.
Code:
Dim level As Integer
Private Sub Command1_Click()
For level = 1 To 100
Next level
End Sub
Private Sub Form_Load()
txtlevel.Text = level
level = 0
End Sub
What I tried was this but it did not work as planned.
Code:
Dim level As Integer
Private Sub Command1_Click()
For level = 1 To 100
level = + 1
`I also tried this: level = level + 1
Next level
End Sub
Private Sub Form_Load()
txtlevel.Text = level
level = 0
End Sub
I'm trying to make it so the you gain + 1 level each time you click the button but you cannot go passed 100. I would really like some help on how to add intergers like this please.
Number Only Text Box
A simple question I'm sure. How do I make a text box only accept numerical input in the format #,##0,00?
Number In To Text
I want to convert a number in to text. I dont know a built in function for this.
100 should be
One Hundred
1001
One Thousend and one
thanks in advance
Text To Number
I know this is a little silly, but I just switched from C++ to VB and while I've used the str() function quite often, I cant find the function to get text converted into a number.
Number To Text
Is it possible to "trick" my app into thinking that my numeric ID is actually text? If so, how?
Thanks
Color Cursor Shows Up B/w
I loaded various color cursors into form/picture box properties but they only show up black on white. Any ideas why?
Unwanted Form Shows
I started programming with a normal form as the startupform. I have several forms now and replaced the initial startupform with an MDI as the startup object (and made all my other forms 'CHILD')...
Unfortunately when I run the program some of my forms are loaded when I'm not wanting them to. I had to add some useless 'Unload frmxx' code to my project to prevent this...
Before, when I didn't have an MDI, it never happened.
I'm almost sure I'm not loading these forms in my code...
How comes they appear anyway
tia
You Slove One Problem And The Next Shows Up
ok i need to clear the form so that the bullets wont make a line but by clearing the form the "plane" blinks and it is very annoying. make it stop blinking or tell me how. sry if the dl doesnt work right this is my first time using it
PPT: Access Custom Shows
I've been looking for help with this for days and I'm just stuck. I want to select powerpoint slides defined in a custom show and copy them to a new presentation. The only thing google turned up was a 3rd party extension...and that won't work. Frustrating.
ActivePresentation.SlideShowSettings _
.NamedSlideShows("Quick Show").Delete
You'd think, I just change "delete" to "copy"...but no...that doesn't work either.
I got this far, but it shows the slide IDs in a message box; I need them to add themselves to a range Array and I can't figure out how to get them there instead of in a mesage box:
idArray = ActivePresentation.SlideShowSettings _
.NamedSlideShows("show a").SlideIDs
For I = 1 To UBound(idArray)
MsgBox idArray(I)
Next
ActivePresentation.Slides.Range(Array(I)).Copy
Presentations.Add WithWindow:=msoTrue
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=1, Layout:=ppLayoutTitle).SlideIndex
ActiveWindow.View.Paste
I'm lost. Any help greatly appreciated.
Form Shows Up Late
I'm making a Form that shows a file copying progress. The copy procedure starts on FormLoad. What I'd like to do is to show the whole form and the label.captions... before it starts copying. 'Cause now it just copies the files and shows the form after that.
Flexgrid Shows No Rows
I've been away from VB stuff for a number of months.
Today I opened up my projects and none of the mshflexgrids shows any rows.
I've got them bound to ado controls. I've tried doing an adoctrl.recordset.recordcount to make sure that there should be rows to show, and I get the correct amount of rows, but the rows never show in flexgrid.
The same is true with all the flexgrids in all my projects.
Control That Shows Webcam
Where can I get a control that shows me my webcam's picture, and let me capture it and stuff? I'm sure that there's already one on my computer, but maybe not.
Thx!
Flexgrid Shows Only One Line
I have a problem where a flexgrid will only display one line of data on one machine in the network - it works perfectly on the other machines in the network.
The data is being loaded from a text array.
Thanks for any hints on what may be causing this strange behaviour.
Nothing Shows After Maximizing The Window
Hi:
I’m relatively new to vb. I’m using vb 6 and am having problems with a window not showing correctly. The application uploads a file via ftp to a server. If the window is minimized while the file is being uploaded and then is maximized again, nothing shows in the window until the file is through uploading. I’m not quite sure where to start to correct this. Any help would be appreciated.
Thanks in advance for the help.
Chris
Which Type Shows Decimal.
Hi, im doing a sub routine that calculates a number that is shown as a currency in an excel sheet.
When i had the variables set to Long's it was fine but seemed to round to the nearest number. I tried variant and that worked but then an adding formula i had wouldnt work because it took the values as strings. So im stuck kinda. Either i find a type that works or find out how to switch the variant into a long in the subroutine. Thanks.
Date Shows Up As Time
When updating a record in my table with a new date, the date shows up as a time when I query the record. Looking at the field inside the actual database it looks like there's a date with the year 1895 (not sure how that got there) and a time. Here's my code:
dteDate = Date
strSQL = "UPDATE Topics SET DocumentName = """ & strFileName & """, ChapterTitle = """ & strChapterTitle & """, TopicTitle = """ & strTopicText & """, Notes = """ & strNotes & """, DateModified = " & dteDate & ", IsAddenda = " & blnIsAddenda & ", ProjectName = """ & strProjectName & """ WHERE ID=" & intRecordID & ""
myDB.Execute (strSQL)
The column in my Access database if set to the ShortDate format. Any ideas? Thanks.
If Nothing Shows Up Have A Listbox Say Sometihng?
Hey guys i have a listbox called list11, and it has the results of a scan from a button. IS there a code to get it that if nothing shows up in the list11 listbox, that an item would show up saying "Nothing found"
??
thank you.
Form That Shows Loading Bar
how would i go about making a preload form that displays a loading bar and then loads the main mdi form after its finished...? here is an example
Frame Shows Form
How can I make a frame(the one vb6 provides) show a form?
I tried this but it didn't work:
Private Sub Frame1_Load()
Frame1 = Form.show
End Sub
Anyone knows how?
VbTab In String Shows A Bar??
I have a string as follows
str = "ABC" & vbTab & "DEF"
when I put str into a flexgrid cell the tab converts into a thick vertical bar.
What do I need to do for it to actually put in a tab?
Thanks as always!
Steve
ps. I am still bang my head against the wall regarding how to define a Band in an Hierarchal Flex Grid (so I can make different columns different background colors)
Textbox That ONLY Shows Numbers ??
How do i make a textbox that you ONLY can write numbers in ?
I thought of something like this:
VB Code:
If txtNumbers.Text = "a" or "A" ThentxtNumbers.Text = ""End If
It works fine, but it will just be a hell of a lot of work !
And i'm... pretty lazy
Regards
A Quickie: Which Example Shows Better Form?
I have a quiz program that runs quizzes built off simple text file scripts.
One of the functions in the quiz editor is to jump the cursor to the first question. To do this I split the lines of the text box into an array called LineStr(). I start from the top and skip the optional file info tags, answer pools, and first chapter mark.
Tell me which way of tackling this a seasoned VB programmer would approve of more:
Code:
x = 0
Do
Temp = Left$(UCase(LineStr(x)), 5)
Select Case Temp
Case "TITL:", "AUTH:", "COMP:", "MODI:", "MVER:", "NOTE:", "TIME:"
x = x + 1
End Select
Loop Until Temp <> "TITL:" And Temp <> "AUTH:" And Temp <> "COMP:" And Temp <> "MODI:" _
And Temp <> "MVER:" And Temp <> "NOTE:" And Temp <> "TIME:"
or
Code:
x = 0
Do
Temp = Left$(UCase(LineStr(x)), 5)
Select Case Temp
Case "TITL:", "AUTH:", "COMP:", "MODI:", "MVER:", "NOTE:", "TIME:"
x = x + 1
Case Else
Exit Do
End Select
Loop
I know it seems totally trivial, but I just want to write code that won't have my fellow programmers scratching their heads or rolling their eyes.
Shows Up In Task Manager.
I'm writing a program in WindowsXP that I don't want to clutter up the users taskmanager window under Applications when its running. Now at first I figured I would have to register it as a service in the API but I found out that you can no longer do that in XP.
I was wondering if anyone else knew how to remove it from the Applications menu, and only make it show up if the click on the Processes menu next too it which shows all exes running.
Thanks for any help which you can render.
Which Control Shows The Desktop
Does anyone know which control, or how to manipulate the DriveList Control, to show the Folders, My Documents, My Computer, and Desktop, As they are shown in the SaveAs Dialog in most of the Office Products?
Thanks In Advance
My Installed .exe Shows A Message
Hey, friends, look what is happening to me:
After finished, I made a distribution package of my VB 6.0 program (.cab, setup.exe, and so on)
I tried to install it in several pc's, all of them with at least win95.
In some of them, when attemping to install, a message appear telling me something is needed about windows installation and the system must be restarted. When this, I did it.
In those cases, after restart the computer, I have to run setup.exe again, and the program is installed succesfully. (it seems to).
But when I try to execute the program at start-programs menu, a new message box appears telling me something like:
"You don't have the right license to use this functionality"
What's happening?
I do not understand why, cause it does not ocurrs in every computer, some of them work perfectly.
Somebody knows why?
Heyner.
Textbox Shows A Date
i am adding a summary to my application ..
how can a text box shows the last modified record date ( the date for the last record entered to the Database ????)
|