473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Tell me where i went wrong

103 100+
want to check all the textboxes are filled and then only we can insert into the database.
i have used the textboxes is clear code
likewise

if text1.text = "" then
msgbox"enter data"
With txtid
.SelStart = 0
.SelLength = Len(txtid.Text)
.SetFocus
End With
Exit Sub
elseif text2.text = "".......like wise
'
'
'
else
conn.execute "insert into..........

but elseif is not executing
tell me where im wrong
Thanks in advance...
Dec 21 '07 #1
7 1021
debasisdas
8,127 Expert 4TB
You need to use nested if for the purpose since using EXIT SUB.
Dec 21 '07 #2
Vbbeginner07
103 100+
You need to use nested if for the purpose since using EXIT SUB.
Im not able to get u ..little bit elaborated
Dec 21 '07 #3
creative1
274 100+
Try something like this:

if text1.text = "" then msgbox"enter data"
With txtid
.SelStart = 0
.SelLength = Len(txtid.Text)
.SetFocus
End With
Exit Sub
IF text2.text = "".......like wise '
'
'
else

Endif ' End of inner IF statement
Endif ' End of Outer If statement

conn.execute "insert into..........
Dec 21 '07 #4
debasisdas
8,127 Expert 4TB
Im not able to get u ..little bit elaborated
Hope the previous post clears your doubt.
Dec 21 '07 #5
Vbbeginner07
103 100+
Try something like this:

if text1.text = "" then msgbox"enter data"
With txtid
.SelStart = 0
.SelLength = Len(txtid.Text)
.SetFocus
End With
Exit Sub
IF text2.text = "".......like wise '
'
'
else
Endif ' End of inner IF statement
Endif ' End of Outer If statement
conn.execute "insert into..........

that too wasnt making out..............!!!
Dec 21 '07 #6
debasisdas
8,127 Expert 4TB
that too wasnt making out..............!!!
try this
Expand|Select|Wrap|Line Numbers
  1. if text1.text = "" then msgbox"enter data"
  2. With txtid
  3. .SelStart = 0
  4. .SelLength = Len(txtid.Text)
  5. .SetFocus
  6. End With
  7. Exit Sub
  8. else
  9. IF text2.text = "".......like wise '
  10. '
  11. '
  12. else
  13.  
  14. Endif ' End of inner IF statement
  15. Endif ' End of Outer If statement
  16.  
Dec 21 '07 #7
Ali Rizwan
925 512MB
want to check all the textboxes are filled and then only we can insert into the database.
I m afraid of this y u all not maintain readability of ur programe.
Use tabs for clean coding.

When u use tabs like

Expand|Select|Wrap|Line Numbers
  1. if text1="" then
  2. msgbox "None"
  3. else
  4.       if text2="" then
  5.       msgbox "None"
  6.       end if
  7. end if
now u know where s the end of first if and where is for second and debugging is easy.

When u r posting any question try to put code quotes around code

Regards

>> ALI <<
Dec 21 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
4
by: Jacinle Young | last post by:
Hi all, I have written the SQL but it doesn't work db2 "select acode from t1 where (acode) not in (select eid from t2 where iid ='0') and iid ='0'" select nothing but the following works
8
by: John Welch | last post by:
I have a command button with the following code: DoCmd.OpenForm "frmSearchAssignments", , , "SearchAssignmentID = 1" (SearchAssignmentID is the PK, auto number) When it runs, the form opens but...
8
by: Brian Basquille | last post by:
Hello all, Bit of a change of pace now. As opposed to the typical questions regarding my Air Hockey game, am also working on a Photo Album which uses an Access Database to store information...
1
by: crystalite | last post by:
hi all, I have a problem for logging in. I want user to log in into their system using company GUID and user GUID. But when the logon button is submitted, the GUIDs(which is captured in the...
7
by: Mufasa | last post by:
I'm trying to know the page that I came from. If I use page.request.urlreferrer it seems to only be filled in once I am on one of the pages within my web site. I'd really like to know what page...
3
by: v.davis2 | last post by:
Hi all, I am attempting to use Access97 as the database to hold the results of a python script. I seem to be able to make simple SELECT clauses work (like SELECT * FROM TableName), but have not...
13
by: RichardL | last post by:
Hi, I tried creating "left" and "right" links on the top of a page I'll be building. I intended them to be on the opposite sides of the first line. That failed. What am I missing? TIA,...
68
by: DaveJ | last post by:
Recently I was working on a project where I came across an issue where the program cored and reported "free(): invalid pointer". I found a resolution for this, but don't fully understand why the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.