我的表单上有一个列表框,这给了我一个错误。
ProductNo
字段是主键。
当我部分输入新记录并决定离开ProductNo
控件到列表框项目时,会发生此错误。
贝娄是我目前的噩梦:
Private Sub InventoryListBox_AfterUpdate()
' Find Record that matches the control.
Dim rst As Object
Set rst = Me.Recordset.Clone
rst.FindFirst "[ProductNo] = '" & Me![ListBox] & "'"
If Not rst.EOF Then
Me.Bookmark = rst.Bookmark 'Error here!
End If
End Sub
答案 0 :(得分:0)
测试$(document).ready(function() {
var infoForm = $('.form form');
infoForm.submit(function() {
// create a var to reference this specific form
var $thisForm = $(this);
// assuming you want to only show the messages nearest to your form,
// you can select the parent div and find the response divs in there too.
// create a reference to the specific parent div (div class="form")
var $parent = $thisForm.parent();
// these will reference the specific fields specific to this form
var formSuccessMsg = $parent.find('p.success');
var formErrorMsg = $parent.find('p.error');
var url = $thisForm.attr('action') + '?showtemplate=false';
var emailInput = $thisForm.find('input[type=text]').val();
if( emailInput.length === 0 || emailInput == '' || !isValidEmailAddress(emailInput) ) {
formErrorMsg.show();
return false;
} else {
$.post(url, $thisForm.serialize(), function(data, textStatus, jqXHR) {
// alert('post came back');
$thisForm.hide();
formErrorMsg.hide();
formSuccessMsg.show();
console.log(emailInput);
});
return false;
}
});
});
属性而不是NoMatch
属性,例如:
EOF
以上假设Private Sub InventoryListBox_AfterUpdate()
Dim rst As Recordset
Set rst = Me.RecordsetClone
rst.FindFirst "[ProductNo] = '" & Me![ListBox] & "'"
If Not rst.NoMatch Then
Me.Bookmark = rst.Bookmark
End If
End Sub
是字符串值字段。