الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

التأكد من أن جميع التيكست بوكس و الكومبو على الفورم غير فارغة قبل الحفظفى قاعدة البيانات

بدأه evry1falls في 2 نوفمبر 2010 · 4 رد · 889 مشاهدة · في لغة Ms Visual Basic 6 وما قبلها من إصدارات
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

Say ......... you have 10 TextBoxes and 10 ComboBoxes on a form and you are taking their contents into a database tables, i guess you have to make sure that all the TextBoxes and the ComboBoxes are Not Empty ... SO you can do something like This ....

CMDSAVE_CLICK

'The button that transfer contents to tables

if textbox1.text And Textbox2.text and ......................................... etc then

msgbox "Leave No Blanks"

exit sub

end if

Some Codes ............

Some Codes ............

rs.update 'Or however you connect

End Sub

OR, You may use something Like this :-

i will try here to tell the VB project that (TxtBx) represents all the TextBoxes Controls on a form (Form1)

and (Cbos) reporests all the ComboBoxes on the same form .... so the senario may be :

Hey, Form1 .... be aware that (TxtBx) represents all my textboxes on You, and (Cbos) represents all my ComboBoexes On you, so whenever you find one Empty Just Give me a MsgBox and (Exit) the sub . ok?

But If not , continue Updating my database tables .... are we clear, form1 ??

How could we just Code These Lines of Senario .......

Here we go :

Visit Me personally
Visit My Facebook VB Page

فى انتظار تعليقاتكم و اسئلتكم على
Evry1falls (Visual Basic) Plus+

 

 

#2

Ah tab3an Ia el code el baset dah yefedeaak

Dim mControl as object

For Each mControl in me.Controls

If Typeof mControl is Textbox then

if mControl.text = "" then msgbox "You Must Fill all Data " : mcontrol.setfocus

elseif Typeof mControl is ComboBox Then

if mControl.listindex = -1 then msgbox "You Must Fill all Data " : mcontrol.setfocus

end if

Next

تم تعديل هذه المشاركة بواسطة kazabra في 3 نوفمبر 2010 في 14:10

#3

شكرا أخى ... بس انا ماعندى مشكله

لو قرأت الموضوع بالكلمل هتلافينى كاتب الكلام ده بالتفصيل

Visit Me personally
Visit My Facebook VB Page

فى انتظار تعليقاتكم و اسئلتكم على
Evry1falls (Visual Basic) Plus+

 

 

#4

لماذا لا تكتب بالعربي من البداية

هداك الله

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…