کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی
کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی

ویژگی FilterOn از فرم



Form.Filter Property


از ویژگی Filter برای تعیین زیر مجموعه ای از رکوردها استفاده کنید تا زمانیکه فیلتر روی فرم ، گزارش ، پرس و جو یا جدول اعمال می شود ، نمایش داده شوند.


ویژگی فیلتر یک عبارت رشته ای است شامل عبارت شرطی بدون حرف کلیدی Where.


Form.Filter="Id=101"

Form.FilterOn=True


برای اعمال فیلترِ خودکار زمان باز شدن فرمی ، در تنظیمات ویژگی رویداد OnOpen فرم ،  یک ماکرو را مشخص کنید که از اکشن یا عملکرد FilterApply استفاده می کند یا یک رویه رویداد ( Event ) که از متد ApplyFilter شئ Docmd استفاده می نُماید.


برای حذف فیلتر ، انتخاب باتن Apply Filter ، انتخاب Remove Filter/Sort در منوی Records  ، یا استفاده از ویژوال بیسیک در تنظبم ویژگی FilterOn به False


expression.ApplyFilter (FilterNameWhereConditionControlName)


حداقل یکی از دو آرگومان های متد ApplyFilter  را باید پر کرد. اگر یک مقدار برای دو آرگومان وارد شود آرگومان   WhereCondition برای فیلتر اعمال می گردد.


حداکثرطول آرگومان WhereCondition عدد ۳۲۶۷۸ کاراکتر است ( بر خلاف آرگومان اکشن یا عملکرد WhereCondition در ماکرو که حداکثر طول ۲۵۶ کاراکتر را می گیرد.)





خبرگزاری فارس: لطف‌اله شیبانی با اشاره به برخورد با زنانی که در اماکن عمومی مبادرت به کشف حجاب می کنند، گفت: طبق بخش نامه دادستان کل کشور مبنی بر ممنوعیت کشف حجاب، برخورد با زنانی که هرگونه رابطه استخدامی با ادارات دولتی دارند و مبادرت به کشف حجاب می کنند، در دستور کار است.



بهمن ۱۴۰۱ : اورخان عسگروف مسئول حراست کشته شده ( در تهران ) از نیروهای امنیتی حکومت آذربایجان مستقر در سفارت بوده است.



به گزارش«انتخاب»، به نقل از ترند، آیخان حاجی‌زاده، سخنگوی وزارت خارجه آذربایجان در گفت‌وگویی با تی آر تی اعلام کرد که دولت باکو درصدد است تا در آینده‌ای نزدیک سفارت خود در ایران را تخلیه کند.

  وی در ادامه گفت: هر کشور مسئول تضمین امنیت سفیران در کشورش است.

او عنوان کرد که طرف ایرانی مسئولیت کامل حمله به سفارت این کشور در تهران را برعهده دارد.

حاجی‌زاده تاکید کرد که "کمپین اخیر ضد آذربایجانی در رسانه‌های ایران زمینه‌ساز این حمله بوده است.

همچنین تی آر تی گزارش داد که فرد مسلح با سلاح کلاشینکف مسئول امنیتی سفارت باکو در تهران را کشته است.


وزارت امور خارجه آذربایجان نیز با انتشار بیانیه ای درباره حمله به سفارت این کشور توضیحاتی داده و اشاره کرده است که در این حادثه یک نفر با اسلحه کلاشینکف حمله کرد و رییس حراست سفارت باکو را کشت، دو محافظ سفارت نیز در جلوگیری از این حمله زخمی شدند. وضعیت آنها رضایت بخش است. این وزارتخانه افزود: کمپین ضد جمهوری آذربایجان در ایران به حمله به سفارت ما در تهران کمک کرد و ایران را به بی‌توجهی به درخواست‌های باکو برای افزایش امنیت سفارت ما در تهران، متهم می‌کنیم.



بهمن ۱۴۰۱ : 

کی روش در جدیدترین مصاحبه با سایت «کوره» مصر گفت: تمام مدارک خود را به وکیلم ارسال کردم تا این قضیه را از فیفا پیگیری کند. همچنان من نتوانستم مطالبات گذشته خودم را را بگیرم و فدراسیون مصر هم جواب تماس های من را نمی دهد.



















( Select Query ( Access برای مشاهده محتویات نیازمند واریز مبلغ مورد نظر است

این مطلب توسط نویسنده‌اش رمزگذاری شده است و برای مشاهده‌ی آن احتیاج به وارد کردن رمز عبور دارید.

Logical Operator

:Table

Orders
OrderID Payment Type Ship State/Province
1 Check IL
2 Check NY
3 Credit Card NY
4 Credit CardCredit IL
5 Check IL


:Query


Qr_Orders
OrderID Payment Type Ship State/Province expr1
1 Check IL -1
2 Check NY -1
3 Credit Card NY 0
4 Credit Card IL 0
5 Check IL -1

expr1: ([orders]![payment type]="check" And [orders]![ship state/province]="ny") Or ([orders]![ship

(" state/province]="il" And Not [orders]![payment type]="credit card


طبق کوئری بالا و عبارت Expr1  رکورد یک :  چون در اینجا بهم ریختگی هنگام نمابش وجود دارد جای نقطه پرانتز بگذارید 


(pay="Check" (True ) And State="ny" (False) Or ..... State="il" (True)  And Not Pay="Credit Card (True

.True And False.   Or .True And True.

False Or True 

True =-1


طبق کوئری بالا و عبارت Expr1  رکورد سه :



(pay="Check" (False ) And State="ny" (True) Or ..... State="il" (False)  And Not Pay="Credit Card (False

.False And True. Or .False And False.

False Or False 

Flase=0


طبق کوئری بالا و عبارت Expr1  رکورد چهار :



(pay="Check" (False ) And State="ny" (False) Or ..... State="il" (True)  And Not Pay="Credit Card (False

.False And False. Or .True And False.

False Or False 

Flase=0





:Query

Qr_Orders
OrderID Payment Type Ship State/Province expr1
1 Check IL -1
2 Check NY -1
4 Credit CardCredit IL -1
5 Check IL -1



مثال دوم  :


:Query

Copy Of Qr_Orders
OrderID Payment Type Ship State/Province expr1
1 Check IL -1
2 Check NY -1
3 Credit Card NY 0
4 Credit Card IL 0
5 Check IL -1
6 Check NX 0
7 Check NZ 0
8 Check IL -1


expr1: ([orders]![payment type]="check") And ([orders]![ship state/province]="ny" Or [orders]![ship

(" state/province]="il




طبق Expr1 در گرید بالا : 

رکورد یک


 (Pay="Check" (True) .... And  State="ny" (False) Or State="il" (True 

.True And .False Or True 

True And True

True=-1

رکورد دو


 (Pay="Check" (True) .... And  State="ny" (True) Or State="il" (False 

.True And .True Or False 

True And True

True=-1

رکورد 6 


 (Pay="Check" (True) .... And  State="ny" (False) Or State="il" (False 

.True And .False Or False 

True And False

False=0



:Query


Copy Of Qr_Orders
OrderID Payment Type Ship State/Province expr1
1 Check IL 0
2 Check NY -1
3 Credit Card NY -1
4 Credit Card IL 0
5 Check IL 0
6 Check NX 0
7 Check NZ 0
8 Check IL 0


expr1: ([orders]![payment type]="check" Or [orders]![payment type]="credit card") And [orders]![ship

("state/province]="ny


رکورد اول 

pay="check" True Or Pay="Credit Card" False.... And State="ny" False

True Or False. And False.

True And False

False=0

رکورد دوم 



pay="check" True Or Pay="Credit Card" False.... And State="ny" True

True Or False. And True.

True And True

True=-1



Copy Of Qr_Orders
OrderID Payment Type Ship State/Province expr1
2 Check NY -1
3 Credit Card NY -1







Filter With CheckBoxes


وقتی تکست 1 با لیبل  "کد از " و تکست 3 با لیبل "کد تا "  نال باشد 


[Between [forms]![Form2]![Text1] And [forms]![Form2]![Text3?

Null

([isnull([forms]![Form2]![Text1?

True

[isnull([forms]![Form2]![Text3)?

True

( null or ( True or true?

True


جواب آخر True شد پس کل داده ها در دیتیل کانتینیوس فرم نمایش داده میشود 


به تکست 1 داده 100 که در جدول از نوع نامبر است داده میشود خروجی به ترتیب زیر است 


[forms]![Form2]![Text1]?

100

[forms]![Form2]![Text3]?

Null

[Between [forms]![Form2]![Text1] And [forms]![Form2]![Text3

Null

([isnull([forms]![Form2]![Text1?

False

([isnull([forms]![Form2]![Text3?

True

( null or ( False or true?

True


اگر در تکست 1 عدد 100 و در تکست 3 عدد 103 وارد شود 


[forms]![Form2]![Text1]?

100

[forms]![Form2]![Text3]?

103

[Between [forms]![Form2]![Text1] And [forms]![Form2]![Text3

100 

([isnull([forms]![Form2]![Text1?

False

([isnull([forms]![Form2]![Text3)?

False

False or False?

False

false Or 100?

 100 

منظور اعداد بین 100 تا 103 را در دیتیل کانتینیوس فرم نشان می دهد 
















فیلتر کوئری بر اساس تایپ داده در تکست باکس


Filter a query based on data entered in a text box


برای باز شدن کوئری میتوان  از ماکرو و اکشن OpenQuery استفاده کرد 





نمونه ماکرو 







ImageProcess Object


زنجیره فیلتر را مدیریت می کند. یک شی ImageProcess را می توان با استفاده از "WIA.ImageProcess" به عنوان ProgID در فراخوانی به CreatObject ایجاد کرد.



مثال Image Resize


Dim Thumb 'As ImageFile
Dim Img 'As ImageFile

Dim IP 'As ImageProcess
"Img ="WIA.ImageFile
"IP ="WIA.ImageProcess
"Thump="WIA.ImageFile

Thumb.LoadFile "C:\WINDOWS\Web\Wallpaper\BlissThumb.bmp"
Img.LoadFile "C:\WINDOWS\Web\Wallpaper\Bliss.bmp"

Set IP.Filters(1).Properties("ImageFile") = Thumb
IP.Filters.Add IP.FilterInfos("Stamp").FilterID
IP.Filters(1).Properties("Top") = Img.Height - Thumb.Height
IP.Filters(1).Properties("Left") = Img.Width - Thumb.Width

Set Img = IP.Apply(Img)

Img.SaveFile "C:\WINDOWS\Web\Wallpaper\BlissStamp.bmp"

---------------------

IP.Filters.Add IP.FilterInfos("RotateFlip").FilterID IP.Filters(1).Properties("RotationAngle") = 90

------------------

IP.Filters.Add IP.FilterInfos("Crop").FilterID
4/IP.Filters(1).Properties("Left") = Img.Width
4/IP.Filters(1).Properties("Top") = Img.Height
 IP.Filters(1).Properties("Right") = Img.Width/ 4
 IP.Filters(1).Properties("Bottom") = Img.Height / 4


FilterInfos Object

شامل مجموعه ای از همه اشیاء FilterInfo موجود است. برای جزئیات بیشتر در مورد دسترسی به شی FilterInfos ، از ویژگی FilterInfos (ImageProcess) در شی ImageProcess دیدن کنید.



To get further documentation for ImageProcess, we can just "ask it"! Run this:

()Sub List_WIA_ImageProcess_Filters
Dim f As Object, x As Long
For Each f In CreateObject("WIA.ImageProcess").FilterInfos
x = x + 1
Debug.Print "#" &x &": " &f.Name &" = " &f.Description &vbLf
Next f
End Sub


RotateFlip = Rotates in 90 degree increments and Flips, horizontally or vertically.

RotationAngle - Set the RotationAngle property to 90, 180, or 270 if you wish
to rotate, otherwise 0 [the default]
FlipHorizontal - Set the FlipHorizontal property to True if you wish to flip
the image horizontally, otherwise False [the default]
FlipVertical - Set the FlipVertical property to True if you wish to flip
the image vertically, otherwise False [the default]
FrameIndex - Set the FrameIndex property to the index of a frame if you
wish to modify a frame other than the ActiveFrame,
otherwise 0 [the default]

Crop = Crops the image by the specified Left, Top, Right, and Bottom margins.


Left - Set the Left property to the left margin (in pixels)
if you wish to crop along the left, otherwise 0 [the default]
Top - Set the Top property to the top margin (in pixels)
if you wish to crop along the top, otherwise 0 [the default]
Right - Set the Right property to the right margin (in pixels)
if you wish to crop along the right, otherwise 0 [the default]
Bottom - Set the Bottom property to the bottom margin (in pixels)
if you wish to crop along the bottom, otherwise 0 [the default]
FrameIndex - Set the FrameIndex property to the index of a frame if you
wish to modify a frame other than the ActiveFrame,
otherwise 0 [the default]


Scale = Scales image to the specified Maximum Width and Maximum Height preserving
Aspect Ratio if necessary.

MaximumWidth - Set the MaximumWidth property to the width (in pixels)
that you wish to scale the image to.
MaximumHeight - Set the MaximumHeight property to the height (in pixels)
that you wish to scale the image to.
PreserveAspectRatio - Set the PreserveAspectRatio property to True
[the default] if you wish to maintain the current aspect
ration of the image, otherwise False and the image will
be stretched to the MaximumWidth and MaximumHeight
FrameIndex - Set the FrameIndex property to the index of a frame if
you wish to modify a frame other than the ActiveFrame,
otherwise 0 [the default]

Stamp = Stamps the specified ImageFile at the specified Left and Top coordinates.


ImageFile - Set the ImageFile property to the ImageFile object that you wish
to stamp
Left - Set the Left property to the offset from the left (in pixels)
that you wish to stamp the ImageFile at [default is 0]
Top - Set the Top property to the offset from the top (in pixels) that
you wish to stamp the ImageFile at [default is 0]
FrameIndex - Set the FrameIndex property to the index of a frame if you wish to
modify a frame other than the ActiveFrame, otherwise 0
[the default]

Exif = Adds/Removes the specified Exif Property.


Remove - Set the Remove property to True if you wish to remove the
specified Exif property, otherwise False [the default] to add the
specified exif property
ID - Set the ID property to the PropertyID you wish to Add or Remove
Type - Set the Type property to indicate the WiaImagePropertyType of the
Exif property you wish to Add (ignored for Remove)
Value - Set the Value property to the Value of the Exif property you wish
to Add (ignored for Remove)
FrameIndex - Set the FrameIndex property to the index of a frame if you
wish to modify a frame other than the ActiveFrame,
otherwise 0 [the default]

#6: Frame = Adds/Removes the specified Frame.


Remove - Set the Remove property to True if you wish to remove the
specified FrameIndex, otherwise False [the default] to Insert the
ImageFile before the specified FrameIndex
ImageFile - Set the ImageFile property to the ImageFile object whose
ActiveFrame that you wish to add (ignored for Remove)
FrameIndex - For Remove, set the FrameIndex property to the index of the frame
you wish to remove, otherwise for add, set the FrameIndex to the
index of the frame to insert the ImageFile before, otherwise 0
[the default] to append a frame from the ImageFile specified


#7: ARGB = Updates the image bits with those specified.

ARGBData - Set the ARGBData property to the Vector of Longs that represent
the ARGB data for the specified FrameIndex (the width and height
must match)
FrameIndex - Set the FrameIndex property to the index of the frame whose ARGB
data you wish to modify, otherwise 0 [the default] to modify the
ActiveFrame


#8: Convert = Converts the resulting ImageFile to the specified type.

FormatID - Set the FormatID property to the supported raster image format
desired, currently you can choose from wiaFormatBMP,
wiaFormatPNG, wiaFormatGIF, wiaFormatJPEG, or wiaFormatTIFF
Quality - For a JPEG file, set the Quality property to any value from 1 to
100 [the default] to specify quality of JPEG compression
Compression - For a TIFF file, set the Compression property to CCITT3, CCITT4,
RLE or Uncompressed to specify the compression scheme,
otherwise LZW [the default]

اصلاح شی imagefile



برای اینکار استفاده از مجموعه ی Filters ، تنظیم پراپرتی مربوطه و نهایتا استفاده ازمتد Apply از شی ImageProcess برای فیلتر کردن شی imagefile 




زنجیره ی فیلتر را مدیریت میکند و از CreateObject برای ایجاد شی  imageprocess  استفاده میکنیم طبق تصویر داکیونت خود آفیس




بازیابی مجموعه ای از فیلترها که در این فرآیند بکار گرفته می شود 



ایجاد فیلتر جدید در مجموعه ی Filters




بازیابی مجموعه ای از تمام فیلترهای دردسترس 




برای اضافه کردن فیلتر به  زنجیره ی فیلتر به FilterId از پر اپرتی های filterinfo احتیاج است 





RotateFlip = Rotates in 90 degree increments and Flips, horizontally or vertically.
RotationAngle - Set the RotationAngle property to 90, 180, or 270 if you wish
to rotate, otherwise 0 [the default]
FlipHorizontal - Set the FlipHorizontal property to True if you wish to flip
the image horizontally, otherwise False [the default]
FlipVertical - Set the FlipVertical property to True if you wish to flip
the image vertically, otherwise False [the default]
FrameIndex - Set the FrameIndex property to the index of a frame if you
wish to modify a frame other than the ActiveFrame,
otherwise 0 [the default]
Crop = Crops the image by the specified Left, Top, Right, and Bottom margins.

Left - Set the Left property to the left margin (in pixels)
if you wish to crop along the left, otherwise 0 [the default]
Top - Set the Top property to the top margin (in pixels)
if you wish to crop along the top, otherwise 0 [the default]
Right - Set the Right property to the right margin (in pixels)
if you wish to crop along the right, otherwise 0 [the default]
Bottom - Set the Bottom property to the bottom margin (in pixels)
if you wish to crop along the bottom, otherwise 0 [the default]
FrameIndex - Set the FrameIndex property to the index of a frame if you
wish to modify a frame other than the ActiveFrame,
otherwise 0 [the default]
Scale = Scales image to the specified Maximum Width and Maximum Height preserving
Aspect Ratio if necessary.
MaximumWidth - Set the MaximumWidth property to the width (in pixels)
that you wish to scale the image to.
MaximumHeight - Set the MaximumHeight property to the height (in pixels)
that you wish to scale the image to.
PreserveAspectRatio - Set the PreserveAspectRatio property to True
[the default] if you wish to maintain the current aspect
ration of the image, otherwise False and the image will
be stretched to the MaximumWidth and MaximumHeight
FrameIndex - Set the FrameIndex property to the index of a frame if
you wish to modify a frame other than the ActiveFrame,
otherwise 0 [the default]
Stamp = Stamps the specified ImageFile at the specified Left and Top coordinates.

ImageFile - Set the ImageFile property to the ImageFile object that you wish
to stamp
Left - Set the Left property to the offset from the left (in pixels)
that you wish to stamp the ImageFile at [default is 0]
Top - Set the Top property to the offset from the top (in pixels) that
you wish to stamp the ImageFile at [default is 0]
FrameIndex - Set the FrameIndex property to the index of a frame if you wish to
modify a frame other than the ActiveFrame, otherwise 0
[the default]
Exif = Adds/Removes the specified Exif Property.

Remove - Set the Remove property to True if you wish to remove the
specified Exif property, otherwise False [the default] to add the
specified exif property
ID - Set the ID property to the PropertyID you wish to Add or Remove
Type - Set the Type property to indicate the WiaImagePropertyType of the
Exif property you wish to Add (ignored for Remove)
Value - Set the Value property to the Value of the Exif property you wish
to Add (ignored for Remove)
FrameIndex - Set the FrameIndex property to the index of a frame if you
wish to modify a frame other than the ActiveFrame,
otherwise 0 [the default]
#6: Frame = Adds/Removes the specified Frame.
Remove - Set the Remove property to True if you wish to remove the
specified FrameIndex, otherwise False [the default] to Insert the
ImageFile before the specified FrameIndex
ImageFile - Set the ImageFile property to the ImageFile object whose
ActiveFrame that you wish to add (ignored for Remove)
FrameIndex - For Remove, set the FrameIndex property to the index of the frame
you wish to remove, otherwise for add, set the FrameIndex to the
index of the frame to insert the ImageFile before, otherwise 0
[the default] to append a frame from the ImageFile specified
#7: ARGB = Updates the image bits with those specified.
ARGBData - Set the ARGBData property to the Vector of Longs that represent
the ARGB data for the specified FrameIndex (the width and height
must match)
FrameIndex - Set the FrameIndex property to the index of the frame whose ARGB
data you wish to modify, otherwise 0 [the default] to modify the
ActiveFrame
#8: Convert = Converts the resulting ImageFile to the specified type.
FormatID - Set the FormatID property to the supported raster image format
desired, currently you can choose from wiaFormatBMP,
wiaFormatPNG, wiaFormatGIF, wiaFormatJPEG, or wiaFormatTIFF
Quality - For a JPEG file, set the Quality property to any value from 1 to
100 [the default] to specify quality of JPEG compression
Compression - For a TIFF file, set the Compression property to CCITT3, CCITT4,
RLE or Uncompressed to specify the compression scheme,
otherwise LZW [the default]

فرضا برای پراپرتی MaximumHeight از Scale در filterinfos استفاده میشود 
متد ImageFile برای بارگذاری و ذخیره 



بکار بستن فیلتر به شی ImageFile یا بعبارتی تغییر پراپرتی مربوطه
 بدین ترتیب اول لود فایل ( LoadFile ) بعد استفاده از متد ImageProcess.Apply
 و نهایتا ذخیره ی فایل با متد SaveFile


ایجاد imageFile 
ایجاد imageprocess
ایجاد فیلتر با filters.add  به  شی imageProcess
استفاده از FilterInfos و FilterId  از شی imageProcess
استفاده از filters و properties از شی imageProcess
لود فایل توسط متد imageFile 
تنظیم آبجکت imageFile برای استفاده از متد Apply از imageProcess
ذخیره ی فایل با استفاده از متد SaveFile مربوط به شی imageFile