Xử lý hiện thông báo khi không nhập dữ liệu vào texbox
Bạn sử dụng event on Lost Focus của textbox muốn ktra. Khi thoát khỏi thì check có IsNull hay kô? nếu IsNull là true thì quay lại ô đó textbox.SetFocus
Vd: bạn có textbox Date
Mã: Private Sub txtDate_LostFocus()
If IsNull(txtDate) Then
MsgBox "Ban phai nhap ngay vao o nay", vbCritical, "Thong bao"
txtDate.SetFocus
Cancel = True
End Sub
Chọn mẫu tin từ list box sang text box
Hỏi:Giúp em phần từ (Item) listbox sang textbox
Đáp:
Có lẽ bạn không cần viết một dòng lệnh nào. Wizard của Access đã giúp bạn làm chuyện này. Cách làm như sau:
Bạn vẽ một list box lên form (sử dụng Wizard). Access cho phép bạn lựa chọn 1 trong 3 tùy chọn. Bạn chọn mục 3 (tìm kiếm mẩu tin dựa vào giá trị được chọn trong list box). Xong, nhắp Next.
Trong màn hình tiếp theo, bạn có thể chọn các trường IDBao, TenBao,...
Màn hình tiếp theo, bạn có thể chọn mục Hide Key Column để ẩn trường IDBao đi. Xong, nhắp Next...
Như vậy, khi bạn chọn một giá trị trong list box, Access sẽ nhảy tới mẩu tin chứa giá trị IDBao mà bạn chọn, tức nó sẽ hiển thị các thông tin của các trường khác.
Bạn lưu ý: Sau khi thiết kế xong list box, bạn không nên đổi tên (name) của nó, vì Access đã phát sinh một đoạn mã trong sự kiện After Update của list box này.
Không biết như vầy có đúng ý bạn không?
Làm thế nào để View report ở chế độ cố định
Hỏi: Làm thế nào để View report ở chế độ cố định
Trả lời :
Mã: Dim stDocName As String
stDocName = "R01_Du An Moi"
DoCmd.OpenReport stDocName, acPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdZoom75
' Các chế độ zoom khác :
Mã: ' DoCmd.RunCommand acCmdFitToWindow
' DoCmd.RunCommand acCmdZoom10
' DoCmd.RunCommand acCmdZoom25
' DoCmd.RunCommand acCmdZoom50
' DoCmd.RunCommand acCmdZoom75
' DoCmd.RunCommand acCmdZoom100
' DoCmd.RunCommand acCmdZoom150
' DoCmd.RunCommand acCmdZoom200
Nguồn: http://my.opera.com/bvlbp/blog/thu-thuat-acc
Import Dữ Liệu Từ Excel Vào Access
Để nhập mới nội dung một table (trong Access) từ một tập tin Excel, ta có thể dùng một trong những cách sau đây:

1. Chọn File \ Get External Data \ Import từ trình đơn Access. Trên hộp thoại Import, chọn mục Microsoft Excel từ danh sách Files of type, rồi chọn tập tin Excel muốn đưa dữ liệu vào Access và bấm OK. Sau đó, theo từng bước hướng dẫn của Access. Tuy nhiên, dữ liệu luôn luôn được đưa vào một table mới, chứ không đưa vào table có sẵn cấu trúc được.
2. Tạo một macro, rồi trên form vẽ một nút lệnh để chạy macro này. Tuy nhiên, các thông số như TableName, FileName cần phải được gõ sẵn, hoặc phải bổ sung thêm một số “kỹ xảo” nữa rất mất công.
3. Cách khác hay hơn: dùng đối tượng DoCmd, một hình thức sử dụng macro của Access trong VBA. Ví dụ: Tạo form như hình 1, gồm có một textbox (đặt tên txtTapTinExcel), một nút lệnh (có dấu 3 chấm, đặt tên cmdTimTapTin), một nút lệnh (để đọc dữ liệu từ tập tin Excel có tên chứa trong ô txtTapTinExcel, đặt tên cmdDocDuLieuTuExcel) và một ActiveX Control có tên dlgTimTapTin. ActiveX Control này được tạo bằng cách bấm nút More Controls (nút cuối cùng) trên ToolBox, rồi chọn mục Microsoft Common Dialog Control. Lần lượt gõ vào các thủ tục xử lý tình huống OnClick của các nút lệnh cmdDocDuLieuTuExcel và cmdTimTapTin (đoạn mã 1). Bạn lưu ý, thứ tự và tên các cột trong tập tin Excel phải giống như cấu trúc table đã khai báo trong Access.
Đoạn mã 1
Mã: Private Sub cmdTimTapTin_Click()
With dlgTimTapTin
.ShowOpen
txtTapTinExcel = .FileName
End With
End Sub
Mã: Private Sub cmdDocDuLieuTuExcel_Click()
Dim sTenTable As String
sTenTable = "tbNhanVien" ‘ Vñ duå
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, _
sTenTable, txtTapTinExcel, True
End Sub
101 reasons why i love you
101 reasons why i love you
1. I love the way we finish each other’s sentences.
2. I love the way I know you’ll never give up on me.
3. I love the fact that I wouldn’t ever give up on you.
4. I love the way you look at me.
5. I love how beautiful your eyes are.
6. I love the way I can’t imagine a day without you in my life.
7. I love the way if we were ever separated I wouldn’t know how to go on.
8. I love the way we cuddle and watch sunsets together.
9. I love the way we sometimes stay up all night and just talk, then watch the sunrise together.
10. I love how I know you’ll always be there when I need you to be.
11. I love the fact that I will always be there for you too.
12. I love how when I dream of my life partner, the only person that I can see is you.
13. I love how complete I feel when I am with you.
14. I love how our bodies just fit together.
15. I love the way you make me laugh.
16. I love the way you laugh.
17. I love the way you won’t compromise yourself when we are together.
18. I love the way you won’t let me compromise myself.
19. I love your thoughtfulness.
20. I love your tenderness.
![[Hình: in_love_by_XxsweeetyXx.jpg]](http://www.look.yeah1.com/albums/userpics/111224/in_love_by_XxsweeetyXx.jpg)
21. I love your ability to speak without saying a single word.
22. I love the way we glance at each other across the room and know what each other is thinking.
23. I love the way, how even though we may be miles apart I still feel like you’re right here with me.
24. I love the way you surprise me with the perfect gifts that show you pay attention to me.
25. I love the way you’ll watch a sporting game with me even though you may not be interested in it.
26. I love the way you treat my friends.
27. I love your love for the things that interest me.
28. I love the way you let me live my life freely without jealousy.
29. I love how you demand respect but are not controlling.
30. I love how I would do anything in this world to make you happy.
31. I love how you would do anything in this world to make me happy.
32. I love the way your voice sounds over the phone.
33. I love the way your voice sounds when you whisper sweet nothings in my ear.
34. I love the completeness and oneness I feel when we make love.
35. I love your sensuality.
36. I love how our romance feels like the perfect romance movie.
37. I love how you are my soul mate.
38. I love the way you handle troubled times.
39. I love the way you respect me.
40. I love the way you protect and defend me.
![[Hình: istockphoto_4923390_sweet_heart.jpg]](http://www1.istockphoto.com/file_thumbview_approve/4923390/2/istockphoto_4923390_sweet_heart.jpg)
41. I love how you feel when we cuddle.
42. I love the softness of your lips against mine.
43. I love the softness of you lips against my body.
44. I love the feeling of your hair brushing against me when we make love.
45. I love laying in bed at night talking about nothing.
46. I love waking up to find we’ve been cuddling together all night.
47. I love the surprises you leave for me.
48. I love your intelligence.
49. I love your ingenuity.
50. I love your ability to make friends where ever we go.
51. I love your love for life.
52. I love your passion for your hobbies and interests.
53. I love how every time I look at you, you take my breath away.
54. I love how I thank God everyday for bringing someone as wonderful as you into my life.
55. I love the fact you gave me the gift of our children.
56. I love the special moments that we shared that will remain my fondest memories of you and I.
57. I love spending the holidays with the one person I love the most.
58. I love how my heart skips a beat whenever you walk into the room.
59. I love how you love me.
60. I love how I love you.
![[Hình: 48474248_heart_153.jpg]](http://img.tamtay.vn/files/2007/11/06/tomythao/photos/164288/48474248_heart_153.jpg)
61. I love the ways you choose to show your affection for me.
62. I love the way you inspire me to be more than I am.
63. I love the way you spark my creativity and imagination.
64. I love the way you make me feel like anything is possible as long as I’m with you.
65. I love your sense of humor.
66. I love the way you make me feel like royalty.
67. I love the way you dress.
68. I love your understated elegance.
69. I love you just the way you are.
70. I love your spontaneity.
71. I love our life together.
72. I love how if I died right now I would be the happiest person alive knowing I found my one true love.
73. I love the fact that we will grow old together.
74. I love your way with words.
75. I love the way you look when your sleeping.
76. I love the way you think you look awful when you first wake up when it is actually then I find you the most beautiful.
77. I love your willingness to share everything and most especially your heart with me.
78. I love your strength of character.
79. I love taking showers together.
80. I love the way you leave me love notes to find whenever you’re gone.
![[Hình: 48474272_heart_154.jpg]](http://img.tamtay.vn/files/2007/11/06/tomythao/photos/164288/48474272_heart_154.jpg)
81. I love the way you treat me.
82. I love the way you take care of us.
83. I love your cooking.
84. I love the way you take the time to thank me for doing every day things.
85. I love the way you show your affection when we are around friends and/or family.
86. I love the way you are not scared to show your affection when we are in public.
87. I love your confidence.
88. I love your ability to make me feel better when times are tough.
89. I love the way we make up after a fight.
90. I love how you treat our children.
91. I love the way you support me when I’m off track.
92. I love the way you take the time to show me how much you love me.
93. I love your beautiful hair.
94. I love your body.
95. I love your openness to try new things.
96. I love your ability to talk things through.
97. I love your courage to be you.
98. I love your greatness.
99. I love the fact that you want to be with me and only me.
100. I love how I am and feel when I am with you!
101. I love you for you!
( sưu tầm)
Chủ đề Mới nhất |
Quản lý kho bằng Accesss
-Chuyên mục: Thảo Luận Access-Đăng bởi lần cuối: thaominhtam-11-09-25, 11:47 AM-
» Bài trả lời: 69-
» Lượt xem: 5,469
|
Quản Lý Phòng Khám Tư Nhâ...
-Chuyên mục: Thư Viện Ứng Dụng-Đăng bởi lần cuối: tt1212-09-09-25, 05:03 PM-
» Bài trả lời: 32-
» Lượt xem: 7,108
|
Thử nghiệm upload hình
-Chuyên mục: Phòng thử nghiệm-Đăng bởi lần cuối: Noname-29-08-25, 09:44 AM-
» Bài trả lời: 2-
» Lượt xem: 686
|
Quản Lý Công Văn
-Chuyên mục: Thư Viện Ứng Dụng-Đăng bởi lần cuối: Adung-23-07-25, 10:05 AM-
» Bài trả lời: 8-
» Lượt xem: 12,946
|
(Update v.1.0.85 - 30/06/...
-Chuyên mục: Thảo Luận Access-Đăng bởi lần cuối: Adung-22-07-25, 10:46 AM-
» Bài trả lời: 270-
» Lượt xem: 113,413
|
Video Tự học Access ( Cơ ...
-Chuyên mục: Thư Viện Giáo Trình-Đăng bởi lần cuối: Nguyễn Đình Thọ-21-07-25, 10:42 AM-
» Bài trả lời: 7-
» Lượt xem: 9,042
|
E chia sẽ Quản lý nhà trọ
-Chuyên mục: Forms-Đăng bởi lần cuối: hoaithanh-18-07-25, 02:28 PM-
» Bài trả lời: 0-
» Lượt xem: 142
|
E xin chia sẻ kiểm phiếu ...
-Chuyên mục: Forms-Đăng bởi lần cuối: hoaithanh-18-07-25, 09:17 AM-
» Bài trả lời: 14-
» Lượt xem: 854
|
Giải pháp Chuyển đổi từ đ...
-Chuyên mục: Thư viện thủ thuật-Đăng bởi lần cuối: ongke0711-09-07-25, 09:52 PM-
» Bài trả lời: 6-
» Lượt xem: 203
|
File Sổ Quỹ Tiền Mặt cho ...
-Chuyên mục: Thư Viện Ứng Dụng-Đăng bởi lần cuối: gatayvn-08-07-25, 04:59 PM-
» Bài trả lời: 31-
» Lượt xem: 4,216
|
Diễn đàn Thống kê |
» Thành viên: 6,400
» Thành viên mới nhất: MikaylaShe
» Các chủ đề diễn đàn: 9,898
» Các bài viết diễn: 48,825
Thống kê đầy đủ
|
| | | | |