VBA в Access error

Весь MS Office, программирование на Visual Basic for Applications и MS VB

Модератор: Naeel Maqsudov

Ответить
Andrei
Сообщения: 1
Зарегистрирован: 22 ноя 2004, 16:15
Откуда: Helsinki
Контактная информация:

Access 2003. Делаю в VB любую функцию, например
Private Sub PVM_Click()
Me.PVM = Now()
End Sub
при выполнении выдаёт ошибку
Visual Basic for Applications (VBA) encountered a problem while attempting to access a property or method. The problem may be one of the following:
A reference is missing.
For help restoring missing references, see the Microsoft Knowledge Base article 283806.
An Expression is misspelled.
Check all expressions used in event properties for correct spelling.
A user-defined function is declared as a sub or as a private function in a module.
Expressions can resolve a user-defined function only if the function is declared as one of the following:
- A public function in a module
- A public or private function in a code module of the current form or report
Security in Access is set to Medium or High and the Microsoft Jet 4.0 SP8 update is not installed.
A more recent verion of Jet 4.0 must be installed for Access to function properly when security is set to Medium or High. To obtain the latest version of Microsoft Jet, go to http://www....
Что бы это могло значить?
Аватара пользователя
Naeel Maqsudov
Сообщения: 2570
Зарегистрирован: 20 фев 2004, 19:17
Откуда: Moscow, Russia
Контактная информация:

encountered a problem while attempting to access a property or method.
Единственнок место где имеется обращение к свойству/методу - это "Me.PVM" просто проверьте, действительно ли так называется элемент управления, лежащий на форме.

При работе с полями есть ограничения.
В некоторых случаях присвоить значение полю нельзя, если оно не в фокусе.
Попробуйте так:

Me.PVM.SetFocus
Me.PVM.Value = Now

Если поле PVM является связанным (т.е. ссылается на поле источника данных) то еще можно использовать какой-то из методов объекта DoCmd для присвоения значений полю.
Ответить