如何使用自动生成的表单编号填充之前输入的数据表单 [英] How do I populate the form with the data entered just previously using auto generated form number

查看:127
本文介绍了如何使用自动生成的表单编号填充之前输入的数据表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个查询表格,接受来自用户的各种输入字段。大多数查询都具有与输入的上一组数据类似的字段。因此,我希望有一个重复的按钮,使用表单编号(要自动生成)使用以前的数据集填充表单。只是为了让用户不必再次输入相同的细节。



i使用未绑定的表格和表来存储每个查询的详细信息。



我尝试过:



私人子b_previous_Click()

'打开上一个表格

Dim new_ticket作为整数

new_ticket = ticket_num - 1



如果不是Me.b_next那么



DoCmd.OpenFormF_inquiry_new,ticket_num& Me.new_ticket&





结束如果

结束次级





PS。我还不知道如何在打开新表单时自动生成表单编号。现在我在表单中实际输入我的票号。

i have an inquiry form that accepts various fields of inputs from the user. most inquiries have similar fields as the previous set of data entered. So i would like to have a duplicate button to populate the form with previous set of data , using the form number (to be auto generated). Just so that user doesn't have to type the same details all over again.

i have used unbound forms and a table to store details of every inquiry.

What I have tried:

Private Sub b_previous_Click()
'open Previous form
Dim new_ticket As Integer
new_ticket = ticket_num - 1

If Not Me.b_next Then

DoCmd.OpenForm "F_inquiry_new ,ticket_num & Me.new_ticket & "


End If
End Sub


PS. i dont know how to auto generate the form number when a new form is opened,yet. For now i physically input my ticket number in the form.

推荐答案

您可以在提交表单时始终填写表格。

添加另一个清除表单并提交的按钮,或者只是清除表单。



你还可以添加类似的东西:

Private Sub TextBox1_GotFocus()

TextBox1.SelStart = 0

TextBox1.SelLength = Len(TextBox1)

结束子



给你的文本框,以便选择全部点击后的文字,然后他们只能覆盖他们想要的方框中的文字。
You could always leave the form populated when they submit the form.
Add another button that clears the form and submits, or just clears the form.

And you can also add something like:
Private Sub TextBox1_GotFocus()
TextBox1.SelStart = 0
TextBox1.SelLength = Len(TextBox1)
End Sub

To you textboxes so that it selects all the text when clicked and then they can just overwrite the text in the boxes they want.


这篇关于如何使用自动生成的表单编号填充之前输入的数据表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆