| 
| 
查看: 943|回复: 2
 | 
关于vb.net的几个小问题
[复制链接] |  
 |  | 
 
| 1)如何在function里触动button1_click? 
 比如说:
 
 Private Function fill_data ()
 
 button1_click()
 
 End Function
 
 Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
 
 msgbox("Hello World")
 
 End Sub
 
 如果我call fill_data的话,就会自动pop up出hello world的msgbox!
 p/s:想知道下可不可能在customer_form call search_form_button1_click呢?
 
 2)Access DB如何辨认日期?
 我的database structure如下
 
 customer_table
 name: Text
 date: Text
 
 customer_table
 name      date
 Jack      3-6-06 (mm:dd:yy)
 Sandy     4-8-06
 Cool      8-4-06
 
 那么sql stament该如何写如果我要找
 
 select name from customer_table WHERE date = 3-1-06 TO 4-25-06
 有什么方法可以做到以上的效果呢,我是用access, date = Text (Data Type)
 | 
 |  |  |  |
 
|  |  |  
|  |  | 
 |  | 
 
 发表于 5-5-2006 11:39 AM
|
显示全部楼层 
| Plz allow me to use english, no chinese input here  Global.vb
 Public FrmSearch As New frm_search
 Public FrmCustomer As New frm_customer
 
 frm_search.vb
 Public Function BtnClick()
 MsgBox "Clicked"
 End Function
 
 Private Sub Button1_click(......)
 BtnClick
 End Sub
 
 frm_customer.vb
 Private Sub Button2_Click(.......)
 FrmSearch.BtnClick
 End Sub
 
 Note: Function BtnClick must be public
 
 For database, i do remember you can use something like:
 SQL = "SELECT * FROM Customer_Table WHERE date>'3-1-06' AND date<'4-25-06'"
 
 But.... i think this function work only for Date data type
 
 Hope this help
 | 
 |  |  |  |
 
|  |  |  
|  |  | 
 |  | 
 
 发表于 5-5-2006 11:41 AM
|
显示全部楼层 
| 原帖由 counterking 于 4-5-2006 01:01 AM 发表1)如何在function里触动button1_click?
 
 比如说:
 
 Private Function fill_data ()
 
 button1_click()
 
 End Function
 
 Private Sub button1_Click(ByVal sender As System.Object,  ...
 你的 date 应该用 date datatype, 才能达到 date compare 的效果.
 | 
 |  |  |  |
 
|  |  |  
|  |  |  |  | 
            本周最热论坛帖子 |