Номер ошибки: | Ошибка 2448 | |
Название ошибки: | You can’t assign a value to this object | |
Описание ошибки: | You can’t assign a value to this object.@* The object may be a control on a read-only form.* The object may be on a form that is open in Design view.* The value may be too large for this field.@@1@1@9424@1. | |
Разработчик: | Microsoft Corporation | |
Программное обеспечение: | Microsoft Access | |
Относится к: | Windows XP, Vista, 7, 8, 10, 11 |
Основы «You can’t assign a value to this object»
«You can’t assign a value to this object» — это стандартная ошибка времени выполнения. Разработчики Microsoft Corporation обычно оценивают Microsoft Access с помощью серии модулей для удаления ошибок в соответствии с отраслевыми стандартами. Хотя эти превентивные действия принимаются, иногда ошибки, такие как ошибка 2448, будут пропущены.
Пользователи Microsoft Access могут столкнуться с сообщением об ошибке после выполнения программы, например «You can’t assign a value to this object.@* The object may be a control on a read-only form.* The object may be on a form that is open in Design view.* The value may be too large for this field.@@1@1@9424@1.». Когда появится ошибка, пользователи компьютеров смогут уведомить разработчика о наличии ошибки 2448 через отчеты об ошибках. Затем Microsoft Corporation нужно будет исправить эти ошибки в главном исходном коде и предоставить модифицированную версию для загрузки. Поэтому, когда вы сталкиваетесь с запросом на обновление Microsoft Access, это обычно связано с тем, что это решение для исправления ошибки 2448 и других ошибок.
Что генерирует ошибку времени выполнения 2448?
В большинстве случаев вы увидите «You can’t assign a value to this object» во время загрузки Microsoft Access. Мы рассмотрим основные причины ошибки 2448 ошибок:
Ошибка 2448 Crash — ошибка 2448 блокирует любой вход, и это может привести к сбою машины. Это происходит много, когда продукт (Microsoft Access) или компьютер не может обрабатывать уникальные входные данные.
«You can’t assign a value to this object» Утечка памяти — Ошибка 2448 утечка памяти происходит и предоставляет Microsoft Access в качестве виновника, перетаскивая производительность вашего ПК. Потенциальным фактором ошибки является код Microsoft Corporation, так как ошибка предотвращает завершение программы.
Ошибка 2448 Logic Error — логическая ошибка возникает, когда компьютер производит неправильный вывод, даже если вход правильный. Виновником в этом случае обычно является недостаток в исходном коде Microsoft Corporation, который неправильно обрабатывает ввод.
В большинстве случаев проблемы с файлами You can’t assign a value to this object связаны с отсутствием или повреждением файла связанного Microsoft Access вредоносным ПО или вирусом. Как правило, самый лучший и простой способ устранения ошибок, связанных с файлами Microsoft Corporation, является замена файлов. В некоторых случаях реестр Windows пытается загрузить файл You can’t assign a value to this object, который больше не существует; в таких ситуациях рекомендуется запустить сканирование реестра, чтобы исправить любые недопустимые ссылки на пути к файлам.
Классические проблемы You can’t assign a value to this object
Усложнения Microsoft Access с You can’t assign a value to this object состоят из:
- «Ошибка в приложении: You can’t assign a value to this object»
- «Ошибка программного обеспечения Win32: You can’t assign a value to this object»
- «You can’t assign a value to this object столкнулся с проблемой и закроется. «
- «You can’t assign a value to this object не может быть найден. «
- «You can’t assign a value to this object не найден.»
- «Проблема при запуске приложения: You can’t assign a value to this object. «
- «You can’t assign a value to this object не выполняется. «
- «Отказ You can’t assign a value to this object.»
- «Ошибка пути программного обеспечения: You can’t assign a value to this object. «
Проблемы You can’t assign a value to this object с участием Microsoft Accesss возникают во время установки, при запуске или завершении работы программного обеспечения, связанного с You can’t assign a value to this object, или во время процесса установки Windows. Важно отметить, когда возникают проблемы You can’t assign a value to this object, так как это помогает устранять проблемы Microsoft Access (и сообщать в Microsoft Corporation).
Корень проблем You can’t assign a value to this object
Большинство проблем You can’t assign a value to this object связаны с отсутствующим или поврежденным You can’t assign a value to this object, вирусной инфекцией или недействительными записями реестра Windows, связанными с Microsoft Access.
В частности, проблемы с You can’t assign a value to this object, вызванные:
- Недопустимые разделы реестра You can’t assign a value to this object/повреждены.
- Файл You can’t assign a value to this object поврежден от вирусной инфекции.
- Другая программа злонамеренно или по ошибке удалила файлы, связанные с You can’t assign a value to this object.
- You can’t assign a value to this object конфликтует с другой программой (общим файлом).
- Поврежденная установка или загрузка Microsoft Access (You can’t assign a value to this object).
Продукт Solvusoft
Загрузка
WinThruster 2023 — Проверьте свой компьютер на наличие ошибок.
Совместима с Windows 2000, XP, Vista, 7, 8, 10 и 11
Установить необязательные продукты — WinThruster (Solvusoft) | Лицензия | Политика защиты личных сведений | Условия | Удаление
Private Sub Form_Open(Cancel As Integer)
Me.Bathroom = Forms!frmBathrooms!ID
Me.txtBathInfo.Caption = "Bathroom Room Number: " &
DLookup("Room", "tblRooms", "ID = " &
DLookup("Room", "tblBathrooms", "ID = " & Me.Bathroom))
Me.RecordSource = "SELECT * FROM tblStalls WHERE Bathroom = " & Me.Bathroom
Me.Recordset.AddNew
End Sub
where Line 2 Me.Bathroom = Forms!frmBathrooms!ID
is tripping the error.
Debugger says Me.Bathroom = 1, Forms!frmBathrooms!ID = 38
. Basically I’m trying to automatically make this form’s Bathroom field match that of the frmBathrooms form’s ID. «Me» is a form for items in the bathroom; there can be many items.
How the hell is that throwing an error? I can’t find anything dispite about an hour of searching around. I understand the message, but not how this could be throwing it?
The Bathroom field of the Item table is in the form’s recordsource, etc. Ideas?
SteveC
15.6k23 gold badges101 silver badges173 bronze badges
asked May 16, 2012 at 19:39
4
Had the same problem, but it had nought to do with VBA syntax.
I attempted to set a control (ordernumber) on a form.
This ordernumber had to be calculated, which i proceeded to do in VBA.
After calculation I would try to set the control (ordernumber) on the form. And that triggered an 2448 error at runtime.
Subsequently I discovered that in form design, i had set the control source to a calculation already. So run-time VBA would not allow me to set the control as well.
After removal of the calculation in the Control Source of the control in the form design —> Property Sheet window it worked fine.
I admit, really stupid mistake, but there you have it.
Hope this helps
—X—
answered Mar 20, 2016 at 10:37
For anyone else having the same problem, all I did was literally move lines 2 and 3 down to below Me.Recordset.AddNew (so that it changes source and adds a new record BEFORE changing the Me.Bathroom and caption). – user1394455
answered May 17, 2012 at 19:48
SeanCSeanC
15.6k5 gold badges45 silver badges65 bronze badges
The main form has to be editable in order to change the drop down list, even in the form header area. (VBA was making it non-editable upon loading.)
Cody Gray♦
238k50 gold badges486 silver badges572 bronze badges
answered Apr 2, 2019 at 12:55
0
The code posted cannot work, because when a form is opened as a dialog:
DoCmd.OpenForm "dlgPrinter", , , , , acDialog, strReport
no other logic after this line is executed until the form has been closed, at which point control returns to the next line after this one, and logic continues on — except of course you can no longer reference anything in that form, because it is now closed.
Ok, now there is a question, where is the button the user clicks to print a report?
What I’m thinking is to split the logic in PrintReport into two methods, one that launches it, and tells the form to configure itself (doing the stuff suggested in the comment), but the rest of PrintReport then needs to happen after the user clicks OK (or Cancel);
So if I assume that you’ve got a form which can launch one or more reports, and the button is on this form, what I would suggest is this:
In the click event for that button — no changes to what you’ve got.
In that buttons form, add this:
Public Sub DialogAccept()
With Forms!dlgPrinter
If .Tag <> "Cancel" Then
Set Reports(strReport).Printer = Application.Printers((!cmbPrinter))
Reports(strReport).Printer.Orientation = !optLayout
Application.Echo False
DoCmd.SelectObject acReport, strReport
DoCmd.PrintOut acPages, !txtPageFrom, !txtPageTo
PrintReport = True
End If
End With
DoCmd.Close acForm, "dlgPrinter"
DoCmd.Close acReport, strReport
Application.Echo True
End Sub
Change PrintReport to:
Public Function PrintReport(strReport As String, strVarName As String, numVal As Long) As Boolean
' open report in PREVIEW mode but HIDDEN
DoCmd.OpenReport strReport, acViewPreview, , strVarName & " = " & numVal, acHidden
'DoCmd.OpenReport strReport, acViewPreview, , , acHidden
' open the dialog form to let the user choose printing options
DoCmd.OpenForm "dlgPrinter", , , , , , strReport
Forms!dlgPrinter.Configure
End Function
In the OK/Cancel button click events on dlgPrinter put (after existing code, but removing any instances of «Docmd.close»):
Forms!Calling_Form_Name.DialogAccept
This then calls that method, to do the stuff that is meant to happen after the user says «I’m done with the dialog».
Finally add the configure method to dlgPrinter:
Public Sub Configure()
With Reports(Me.Tag).Printer
Me!cmbPrinter = .DeviceName
Me!optLayout = .Orientation
End With
Dim numPages As String
numPages = Reports(Me.Tag).Pages
Debug.Print "numPages = " & numPages
TypeName(Me.txtPageTo) 'added this line as a test after
Me.txtPageTo.Value = numPages
End Sub
And remove this code section from Form_Load.
Hoep this helps.
Lastly, if the form on which the button launching dlgPrinter can vary, change this line:
DoCmd.OpenForm "dlgPrinter", , , , , acDialog, strReport
to:
DoCmd.OpenForm "dlgPrinter", , , , , acDialog, strReport & ";" & me.Name
In form_load of dlgPrinter, break up me.Openargs using left() & mid() with instr(), and save me.Name into the tag of something on the form (which you’re not already using the tag of).
In the OK/Cancel button click events, change the code above to:
Forms(Object.Tag).DialogAccept
Private Sub Form_Open(Cancel As Integer)
Me.Bathroom = Forms!frmBathrooms!ID
Me.txtBathInfo.Caption = "Bathroom Room Number: " &
DLookup("Room", "tblRooms", "ID = " &
DLookup("Room", "tblBathrooms", "ID = " & Me.Bathroom))
Me.RecordSource = "SELECT * FROM tblStalls WHERE Bathroom = " & Me.Bathroom
Me.Recordset.AddNew
End Sub
Где строка 2 Me.Bathroom = Forms!frmBathrooms!ID
вызывает ошибку. Отладчик говорит: Me.Bathroom = 1, Forms!frmBathrooms!ID = 38
. В основном я пытаюсь автоматически сделать так, чтобы поле ванной этой формы соответствовало идентификатору формы frmBathrooms. «Я» — форма для предметов в ванной; может быть много предметов.
Как, черт возьми, это вызывает ошибку? Я не могу найти ничего, несмотря на час поисков. Я понимаю сообщение, но не как это могло его выбросить?
Поле «Ванная комната» таблицы «Предмет» находится в источнике записей формы и т. Д. Идеи?
3 ответа
Лучший ответ
Для всех, у кого была такая же проблема, все, что я сделал, это буквально переместил строки 2 и 3 вниз, ниже Me.Recordset.AddNew (так, чтобы он менял источник и добавлял новую запись ПЕРЕД изменением Me.Bathroom и заголовка). — user1394455
2
SeanC
17 Май 2012 в 19:48
Была та же проблема, но это не имело никакого отношения к синтаксису VBA. Я попытался установить элемент управления (порядковый номер) в форме. Этот номер заказа нужно было вычислить, что я и сделал в VBA. После расчета я бы попробовал установить элемент управления (порядковый номер) на форме. И это вызвало ошибку 2448 во время выполнения. Впоследствии я обнаружил, что при проектировании форм я уже установил источник управления для вычисления. Таким образом, VBA во время выполнения не позволил мне также установить элемент управления. После удаления расчета в Control Source элемента управления в окне дизайна формы -> Property Sheet он работал нормально. Признаюсь, действительно глупая ошибка, но вот она. Надеюсь, это поможет —X—
2
Xander
20 Мар 2016 в 10:37
Основная форма должна быть редактируемой, чтобы можно было изменять раскрывающийся список, даже в области заголовка формы. (VBA делал его недоступным для редактирования при загрузке.)
0
Cody Gray
8 Апр 2019 в 17:44
- Remove From My Forums
-
Question
-
Access 2013.accdb upgrade of an old .mdb vintage unknown
In a form I can have in the On Current Event: me.FieldName=2
this works fine; the field value is always 2 for any record I go to….
FieldName is a bound field to the record source and FieldName is both the textbox name and the table field’s name….
But if I put that in the Before Update Event — the 2448 error is triggered when attempting this same code line
Am trying to understand this and would welcome advice
Answers
-
You just simply cannot modify a field value in the BeforeUpdate event. You can do it in the AftreUpdate event.
Matthias Kläy, Kläy Computing AG
-
Proposed as answer by
Tuesday, May 5, 2015 2:11 AM
-
Marked as answer by
Fei XueMicrosoft employee
Monday, May 18, 2015 10:07 AM
-
Proposed as answer by