Im making a small program to determine to sizes of video files. I've previously made two forms to calculate the sizes of compressed and uncompressed video files; however, I'm also trying to make another form that allows the user to enter a particular storage space in which the program then determines the best recommended video/audio bitrate (kb/sec) for the file.

Problem is I get a type mismatch error at 'VBitrate = txtVBR', the properties of that text box seem fine so I assume there is a problem in the code somewhere?

------------------------------------------------------
Private Sub CmdCRB_Click()

Dim KByte As Single
Dim MByte As Single
Dim GByte As Single
Dim Hours As Single
Dim Minutes As Single
Dim Seconds As Single

Dim FileLength As Single
Dim VBitrate As Single
Dim ABitrate As Single
Dim FVBitrate As Single

KByte = txtKB
MByte = txtMB
GByte = txtGB
Hours = txtHours
Minutes = txtMinutes
Seconds = txtSeconds
VBitrate = txtVBR
ABitrate = txtABR

FileLength = (Hours * 3600) + (Minutes * 60) + Seconds
VBitrate = FileLength / ((KByte * 8) + (MByte * 8192) + (GByte * 8388608))
ABitrate = FileLength / 224
FVBitrate = VBitrate - ABitrate

txtVBR = Str$(FVBitrate) & " Kb/sec "
txtABR = Str$(ABitrate) & " Kb/sec"

End Sub
------------------------------------------------------

Also the program will also crash if I type a letter in a text box or leave it blank?

Im pretty sure it's something simple although I'm quite new at this and can't see it.

Any help would be much appreciated