473,320 Members | 2,000 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Enter a text from Form to another Form

Hi,

I would like to ask for your help on the following issue in MS Access.

I had created a form "CustomerListF", filled with command buttons for each client. For each button, I had created the following code:

Private Sub cmd_outlets_ABC_Click()
DoCmd.OpenForm "OrderFormF"
Forms!OrderFormF!Outlets = "ABC"
End Sub

The button would then open another form "OrderFormF" and enter "ABC" in the textbox named "Outlets". However, I realized the second line of code (Forms!OrderFormF!Outlets = "ABC") would always create a phantom record in my subform, which is located in "OrderFormF", and this record would travel to other clients' forms. This phantom record is usually created when the commandbutton is clicked twice (double clicks or subsequent clicks). It is a headache when the record starts to shift around.

I would like to seek your advice for vba code to edit the second line of code.

Thank you.
Aug 13 '16 #1
3 1010
jforbes
1,107 Expert 1GB
What is the point of the line?
Expand|Select|Wrap|Line Numbers
  1. Forms!OrderFormF!Outlets = "ABC"
Because it will most likely create a new record. You might be better off setting the Default Value of Outlets to ABC and then letting the user create new records, or create a button on the OrderFormF to create a new record.
Aug 16 '16 #2
I created the Access for my mother to use on a touchscreen. Henceforth, all customers are in the form of command buttonns.

The line was supposed to open a form, and enter "ABC" in the "Outlets" field.

I cannot set the Default Value of Outlets to "ABC" as I have a list of clients. Henceforth, whenever I click the button, it would show the order form of the every customer.

Please advice.
Aug 16 '16 #3
jforbes
1,107 Expert 1GB
Then I don't understand the purpose of
Expand|Select|Wrap|Line Numbers
  1. Forms!OrderFormF!Outlets
Is it a Text Field in the Table or a TextBox? Why is important that you fill it in?
Aug 16 '16 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: iggie | last post by:
Hello, everyone. How can I display text from another form that currently has the focus. I'm doing a search in sql 2000, to dot it. I call a search form and query my criteria, when it founds the...
1
by: John | last post by:
My data has 10 accounts. Two forms are opened simultaneously. Form1 is unbound and displays three records: Account Quantity 101 17 104 25 107 ...
1
by: David | last post by:
Hi, I have a form which requires Serial Numbers to be loaded from another form. When I press a button, another form opens with a list of Serial Numbers. I have the record selectors enabled. ...
3
by: fh1996 | last post by:
Form.Owner and Form.Parent, what's the difference between them? Form.ShowDialog() and Form.Show(), when to use which? Form.Activated(), what does it mean when saying a Form is "activated"? ...
16
by: Adda | last post by:
If I cycle through the MdiChildActivate event of the parent form I can read text in a textbox on the child mdiform -- console.writeline(Me.ActiveMdiChild.Controls(1).Text) But if I have a sub...
6
by: Roger Ries via DotNetMonster.com | last post by:
I'm trying to change the text in a label from another form. lblInfo.Text = "ABC" Works for the form your currently in but how the heck do you change that label information from another form. ...
4
by: RSH | last post by:
I have a basic framework where I have a frmMain which is my main form that is opened when the application is run. Upon a button click I have a second from that is opened as such: Form FormB =...
1
by: aman909 | last post by:
Hello, I have a unbound text box on a form. This gives a total from a calculation. I would like this total from the unbound text box to appear on another form. I just need the total on the...
13
by: DDragon | last post by:
ok here is the problem, i have to forms which have values i wish to be added together i can add together the values in one form all right but im having problems with adding the values of the other...
0
by: cheekangteh | last post by:
currently i am doing sms function by using window mobile standard 6. i have multiple form, up to 4 window form. and at the last form, i wish to collect all the data that already key in in previous...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.