ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¬°¦óTextboxªºSetfocusµLªkµo´§¥\¯à©O¡H

¬°¦óTextboxªºSetfocusµLªkµo´§¥\¯à©O¡H

¦U¦ì¤j¤j¦n¡G

    ¤p§Ì±`±`¨Ï¥Îªí³æ¾Þ§@¡A
¦ý¤@ª½·|¹J¨ì­n¨Ïªí³æ¤Wªº
textbox¯à¦b¤@¶}±Òªí³æ®É
¯à±N¾nÂI°±¦bTextbox¤W¡A
¬°¦ó¨Ï¥ÎTextboxªºSetfocus
«o·|µLªkµo´§¨ä¥\¯à©O¡H

·PÁ¦U¦ì¤j¤j¡I

TEST.rar (11.51 KB)

¦^´_ 6# dds727
Me![id] ³oµ{¦¡½X ¦b 2003¬O¿ù»~ªº   ¤£ª¾§A¬O¥Î¦óºØExcelª©¥» .
SetFocus ¤èªk  Áä½Lªº¾nÂI²¾¨ì«ü©w©R¥O¦C±±¨î¶µ¡A³o¼Ë¸Ó©R¥O¦C±±¨î¶µ´N¥i±µ¦¬Áä½L¿é¤J¡C¥Î¨Ó¾ÞÁa±±¨î¶µªºÁä½L¿é¤J«¬ºAµø¸Ó±±¨î¶µªº«¬ºA¦Ó©w¡C  ³o¬O ±±¨î¶µ ªº ¤èªk
¦p¬OÀx¦s®æ  ½Ð¥Î [id].Select

TOP

¦^´_ 4# GBKEE
½Ð°Ý¤j¤j~~
§Q¥ÎAfterUpdate()ÅçÃÒ¨­¤ÀÃÒ¦r¸¹¿ù»~«á¡A¬O§_¥i¥H§Q¥Îsetfocus±N«ü¼Ð«ü©w¦b¨­¥÷ÃÒ¦r¸¹ªºÄæ¦ì¤W©O?
§Úªºµ{¦¡½X¦p¤U:
Private Sub id_AfterUpdate()
Dim mPID As String
mPID = Me![id]
mAE = Left(mPID, 1)
mSE = Mid(mPID, 2, 1)

Aer = DLookup("Numb", "CITYID", "[CODE]='" & mAE & "'")
chk = (Mid(Aer, 1, 1) + Mid(Aer, 2, 1) * 9 + Mid(mPID, 2, 1) * 8 + Mid(mPID, 3, 1) * 7 + Mid(mPID, 4, 1) * 6 + Mid(mPID, 5, 1) * 5 + Mid(mPID, 6, 1) * 4 + Mid(mPID, 7, 1) * 3 + Mid(mPID, 8, 1) * 2 + Mid(mPID, 9, 1) * 1 + Mid(mPID, 10, 1) * 1) Mod 10

If chk <> 0 Then
    MsgBox "¨­¤ÀÃÒ¸¹½X¿é¤J¿ù»~!!! ½Ð­«·s¿é¤J"
    Me![id] = ""
    Me![id].SetFocus
   
    Exit Sub
Else
    MsgBox "¨­¤ÀÃÒ¸¹½X¿é¤J¥¿½T!!!"
               
            Select Case mSE
                Case "1"
                    Me![e] = "¨k"
                    Me![Sexl].Value = "1"
                Case "2"
                    Me![e] = "¤k"
                    Me![Sexl].Value = "2"
            End Select
End If
End Sub

ÀYµhªº¤p¾Ç¥Í 2012.7.14

TOP

ÁÂÁª©¥D¤j¤j¡C

¤p§Ì¤w¦¬¤U¡A
¨Ã¦n¦n¬ã¨s¤ÎÅé·|¨ä§t·N¡C

·P®¦¤j¤j¡I

TOP

¤p§Ì¤Þ¥Î¤j¤j±Nuserformªºinitialize¤º®e¨ú®ø¤§«á¡A¤w¥iÅýtextboxªºsetfocusµo´§¨ä¥\¯à¡C
dechiuan999 µoªí©ó 2010-8-6 08:41

¯u¥¿ªºµo´§¨ä¥\¯à¦b¦¹
Private Sub CommandButton1_Click()
    TextBox1.SetFocus
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub UserForm_Initialize()
    'CommandButton1 ³]©wÄÝ©Ê
    With CommandButton1
        .Caption = "µo°e " & .Caption
        .Font.Size = 14
        .Font.Bold = True
        .Width = .Width + 30
    End With
End Sub

TOP

ÁÂÁª©¥D¤j¤jªº»¡©ú¡C
¤p§Ì¤Þ¥Î¤j¤j±Nuserformªºinitialize
¤º®e¨ú®ø¤§«á¡A¤w¥iÅýtextboxªºsetfocus
µo´§¨ä¥\¯à¡C

¤£¹L¡Aª©¥D¤j¤j¹ïinitializeªº»¡©ú¡A
¤p§Ì¤]´¿ª½±µ¦bexcel help¤ºÆ[¬Ý¨ä»¡©ú¡A
¹ê¦]¤p§Ì¸ê½è©|²L¡AÁÙµLªk¯à¥þµM²z¸Ñ¨ä§t·N¡C

¤£ª¾¯à§_½Ðª©¥D¤j¤j¯à¦A¦h¦h¶}¥Ü¡C
·P®¦¤j¤j¡I

TOP

¦^´_ 1# dechiuan999
¸Õ¸Õ¬Ý
­×¥¿§AªºUserform1µ{¦¡½X¦p¤U
  1. Private Sub CommandButton1_Click()
  2.     TextBox1.SetFocus
  3. End Sub
  4. Private Sub CommandButton2_Click()
  5.     Unload Me
  6. End Sub
  7. Private Sub TextBox1_Change()
  8.     TextBox1.Text = UCase(TextBox1.Text)
  9.     'TextBox1.SetFocus
  10. End Sub
  11. Private Sub UserForm_Initialize()
  12.     '¦¹µ{¦¡µo¥Í¦b¤@­Óª«¥ó¸ü¤J«á¡A¦ý©|¥¼Åã¥Üªº®É­Ô¡C
  13.     '±z¥i±NÅܼƫü©w¬°°_©l­È¡A¥B±±¨î¶µ¥i¥H²¾°Ê©Î§ïÅܤj¤p¨Ó°t¦Xªì©l¸ê®Æ¡C
  14.     'Userform1.TextBox1.Text = UCase(TextBox1.Text)
  15.     'Userform1.TextBox1.SetFocus
  16. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : Ä@­n¤j¡B§Ó­n°í¡B®ð­n¬X¡B¤ß­n²Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD