我有这个代码
Private Sub cmdBrowse_Click()
Dim FileOpenDialog As FileDialog
Set FileOpenDialog = Application.FileDialog(msoFileDialogFilePicker)
Dim SelectedFile As Variant
Dim db As DAO.Database
Set db = CurrentDb
With FileOpenDialog
.AllowMultiSelect = False
.Title = "Select A File To Use As A Logo"
.Filters.Clear
.Filters.Add "Images", "*.gif; *.jpg; *.jpeg;*.bmp;*.png"
.ButtonName = "Use This File"
If .Show = True Then
For Each SelectedFile In .SelectedItems
Dim LogoFile As String
LogoFile = SelectedFile
Dim barewabarayate As Recordset
Set barewabarayate = db.OpenRecordset("barewabarayate")
With barewabarayate
.Edit
barewabarayate.Fields("image_path") = LogoFile
barewabarayate.Update
End With
Next
End If
End With
End Sub
当我单击cmdbrowse按钮打开图像时,它成功运行并在我的图像控件中显示所选图像,它还将图像路径存储在我的表格字段中...我的问题是当我点击表单上的下一个按钮更改记录时它显示我的表中的每个记录的图像我希望我的代码存储图像路径只有一个记录而不是所有记录?