מודול אקסס שמבקש רישום מהרגיסטרי

אביי

משתמש מקצוען
עיצוב גרפי
UX UI
D I G I T A L
בס"ד

אני זקוק למודול באקסס שפתיחת הקובץ מבקש מהרגיסטרי נתונים
מי שיש לו כזה ויוכל להעביר לי את זה אני יודה לו מאד.
 

אביי

משתמש מקצוען
עיצוב גרפי
UX UI
D I G I T A L
חסום לי! אפשר במגיקוד ? (עם יש שם הדרכה כלשהי עדיף גם אותה בפידיאף)
תודה!
 

FullTime

משתמש מקצוען
תבדוק את זה:
קוד:
Sub ChangeCommentWith()

Dim myRegKey As String
Dim myValue As String
Dim myFileAs As String
Dim myAnswer As Integer
 
  'get registry key to work with
  myRegKey = "HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\MailSettings\MarkComments"
  If myRegKey = "" Then Exit Sub
  'check if key exists
  If RegKeyExists(myRegKey) = True Then
    'key exists, read it
    myValue = RegKeyRead(myRegKey)
    If myValue = 1 Then myValue = "0" Else myValue = 1
      Else
    myValue = 1
   End If
 
    If myValue <> "" Then
      RegKeySave myRegKey, myValue
      MsgBox "Registry key set to " & myValue
  End If

End Sub

'reads the value for the registry key i_RegKey
'if the key cannot be found, the return value is ""
Function RegKeyRead(i_RegKey As String) As String
Dim myWS As Object

  On Error Resume Next
  'access Windows scripting
  Set myWS = CreateObject("WScript.Shell")
  'read key from registry
  RegKeyRead = myWS.RegRead(i_RegKey)
End Function

'sets the registry key i_RegKey to the
'value i_Value with type i_Type
'if i_Type is omitted, the value will be saved as string
'if i_RegKey wasn't found, a new registry key will be created

' change REG_DWORD to the correct key type
Sub RegKeySave(i_RegKey As String, _
              i_Value As String, _
     Optional i_Type As String = "REG_DWORD")
Dim myWS As Object

  'access Windows scripting
  Set myWS = CreateObject("WScript.Shell")
  'write registry key
  myWS.RegWrite i_RegKey, i_Value, i_Type

End Sub

'returns True if the registry key i_RegKey was found
'and False if not
Function RegKeyExists(i_RegKey As String) As Boolean
Dim myWS As Object

  On Error GoTo ErrorHandler
  'access Windows scripting
  Set myWS = CreateObject("WScript.Shell")
  'try to read the registry key
  myWS.RegRead i_RegKey
  'key was found
  RegKeyExists = True
  Exit Function
 
ErrorHandler:
  'key was not found
  RegKeyExists = False
End Function

מקור
 
נערך לאחרונה ב:

אביי

משתמש מקצוען
עיצוב גרפי
UX UI
D I G I T A L
תבדוק את זה:
קוד:
Sub ChangeCommentWith()

Dim myRegKey As String
Dim myValue As String
Dim myFileAs As String
Dim myAnswer As Integer
 
  'get registry key to work with
  myRegKey = "HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\MailSettings\MarkComments"
  If myRegKey = "" Then Exit Sub
  'check if key exists
  If RegKeyExists(myRegKey) = True Then
    'key exists, read it
    myValue = RegKeyRead(myRegKey)
    If myValue = 1 Then myValue = "0" Else myValue = 1
      Else
    myValue = 1
   End If
 
    If myValue <> "" Then
      RegKeySave myRegKey, myValue
      MsgBox "Registry key set to " & myValue
  End If

End Sub

'reads the value for the registry key i_RegKey
'if the key cannot be found, the return value is ""
Function RegKeyRead(i_RegKey As String) As String
Dim myWS As Object

  On Error Resume Next
  'access Windows scripting
  Set myWS = CreateObject("WScript.Shell")
  'read key from registry
  RegKeyRead = myWS.RegRead(i_RegKey)
End Function

'sets the registry key i_RegKey to the
'value i_Value with type i_Type
'if i_Type is omitted, the value will be saved as string
'if i_RegKey wasn't found, a new registry key will be created

' change REG_DWORD to the correct key type
Sub RegKeySave(i_RegKey As String, _
              i_Value As String, _
     Optional i_Type As String = "REG_DWORD")
Dim myWS As Object

  'access Windows scripting
  Set myWS = CreateObject("WScript.Shell")
  'write registry key
  myWS.RegWrite i_RegKey, i_Value, i_Type

End Sub

'returns True if the registry key i_RegKey was found
'and False if not
Function RegKeyExists(i_RegKey As String) As Boolean
Dim myWS As Object

  On Error GoTo ErrorHandler
  'access Windows scripting
  Set myWS = CreateObject("WScript.Shell")
  'try to read the registry key
  myWS.RegRead i_RegKey
  'key was found
  RegKeyExists = True
  Exit Function
 
ErrorHandler:
  'key was not found
  RegKeyExists = False
End Function

מקור
זה נראה עובד, אבל יש לך מושג איך אני גורם לקריקטוריון להיות נצרך שבלעדיו האקסס לא יעלה?
 

FullTime

משתמש מקצוען
תוסיף אירוע בעת טעינה על הטופס הראשון שאתה פותח, שבודק את הנתון.
אם הוא שונה ממה שבא לך, שהקובץ ייסגר.
 

אביי

משתמש מקצוען
עיצוב גרפי
UX UI
D I G I T A L
תוסיף אירוע בעת טעינה על הטופס הראשון שאתה פותח, שבודק את הנתון.
אם הוא שונה ממה שבא לך, שהקובץ ייסגר.
הוא מסמן לי שגיאה:
upload_2019-4-1_19-0-10.png
 

אביי

משתמש מקצוען
עיצוב גרפי
UX UI
D I G I T A L
את הסיסמא אני צריך להזין איפה שכתבתי 12345 או בנתיב של הרגיסטרי?
תודה!
 

FullTime

משתמש מקצוען
הכנסת את האירוע בתוך הקוד.
השורה של sub לא צריך להיות.
כנראה גם בסוף יש לך end sub
 

Yaron31

משתמש חדש
יש לי שאלה יש לי טופס ראשי ובתוכות טופס משנה בחלקו התחתון
הייתי רוצה לדעת איך אני שם תיבה משולבת בחלק עליון ולדפדף את הטופס המשנה שבחלקו התחתון
ניתן גם על ידיי לחצן תודה.....
 

ari rm

משתמש פעיל
בס"ד

ע"י תיבת רשימה:
שבה יש את המזהה שעל פיו אתה רוצה לסנן את טופס המשנה, ובמאפיינים של טופס המשנה בחר בקישור שדה אב את המזהה הנ"ל

ע"י לחצן:

אם זה "הבא" או "הקודם" אתה יכול להעביר את המוקד לטופס המשנה (או לפקד שנמצא שם), ולעבור רשומה או קדימה או אחורה, ע"י
DoCmd.GoToRecord , "", acNext
או
DoCmd.GoToRecord , "", acPrevious
כמובן: כל הנ"ל רק אם טופס המשנה הוא טופס יחיד
 

אולי מעניין אותך גם...

הפרק היומי

הפרק היומי! כל ערב פרק תהילים חדש. הצטרפו אלינו לקריאת תהילים משותפת!


תהילים פרק קיט ב'

ט בַּמֶּה יְזַכֶּה נַּעַר אֶת אָרְחוֹ לִשְׁמֹר כִּדְבָרֶךָ:י בְּכָל לִבִּי דְרַשְׁתִּיךָ אַל תַּשְׁגֵּנִי מִמִּצְוֹתֶיךָ:יא בְּלִבִּי צָפַנְתִּי אִמְרָתֶךָ לְמַעַן לֹא אֶחֱטָא לָךְ:יב בָּרוּךְ אַתָּה יְהוָה לַמְּדֵנִי חֻקֶּיךָ:יג בִּשְׂפָתַי סִפַּרְתִּי כֹּל מִשְׁפְּטֵי פִיךָ:יד בְּדֶרֶךְ עֵדְוֹתֶיךָ שַׂשְׂתִּי כְּעַל כָּל הוֹן:טו בְּפִקֻּדֶיךָ אָשִׂיחָה וְאַבִּיטָה אֹרְחֹתֶיךָ:טז בְּחֻקֹּתֶיךָ אֶשְׁתַּעֲשָׁע לֹא אֶשְׁכַּח דְּבָרֶךָ:
נקרא  6  פעמים

לוח מודעות

למעלה