Connecting Tech Pros Worldwide Forums | Help | Site Map

max records

lee123's Avatar
Site Addict
 
Join Date: Feb 2007
Location: United States
Posts: 532
#1: Jan 13 '08
hi there im doing a apartment project where i live and there are only 72 apt's how do make it so when it reaches 72 you can't add anymore lessors in my form i have a Add button that's controled by a adodc control. i tried this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdADD_Click()
  2. If txtid.text  >= 72  Then
  3.   cmdadd.enabled= false
  4. ElseIF txtID.text  <=72  Then
  5.   cmdAdd.enabled=true
  6. End IF
but it doesn't work why? or does someone else have any other idea's if you do please share.

lee123

mafaisal's Avatar
Familiar Sight
 
Join Date: Sep 2007
Location: Cochin,India
Posts: 138
#2: Jan 13 '08

re: max records


Hello Lee
txtid.text is string
u use
if val(txtid.text) >= 72 then

Try

Quote:

Originally Posted by lee123

hi there im doing a apartment project where i live and there are only 72 apt's how do make it so when it reaches 72 you can't add anymore lessors in my form i have a Add button that's controled by a adodc control. i tried this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdADD_Click()
  2. If txtid.text  >= 72  Then
  3.   cmdadd.enabled= false
  4. ElseIF txtID.text  <=72  Then
  5.   cmdAdd.enabled=true
  6. End IF
but it doesn't work why? or does someone else have any other idea's if you do please share.

lee123

lee123's Avatar
Site Addict
 
Join Date: Feb 2007
Location: United States
Posts: 532
#3: Jan 13 '08

re: max records


thanks mafaisal,

it worked!

lee123
Reply


Similar Visual Basic 4 / 5 / 6 bytes