Entering the same value into two table fields at the same time

Say that there is a table which has 2 fields (A, B)
There is a form [Form1] (data entry type) to enter data for A by
`TextBoxA`.
There is also one more `TextBoxB` which is Not Visible.

My target is to record the value of (entered thtough `TextBoxA`) into
B field of the table as well.
So I write down a code "Before Insert" of the Form1 that:

" Form_Form1.TextBoxB = Form_Form1.TextBoxA "

It is not recording A values into the field B... Where am I wrong? Can
you help me please?

0
mezzanine1974
9/3/2007 12:31:30 PM
access.formscoding 7493 articles. 0 followers. Follow

3 Replies
1306 Views

Similar Articles

[PageSpeed] 51

Sory !!!
When I write down the same code into `OnExit` of TextBoxA, it is
working...!!


0
mezzanine1974
9/3/2007 12:37:50 PM
yes, that will work, but i'd recommend that you use TextBoxA's AfterUpdate
event, rather than the Exit event - that way the code runs only when data is
actually entered or edited in TextboxA, rather than every time you Exit the
control.

though i must say that it seems very strange to me that you are storing
duplicate data in your table.

hth


"mezzanine1974" <savas_karaduman@yahoo.com> wrote in message
news:1188823070.806799.232910@y42g2000hsy.googlegroups.com...
> Sory !!!
> When I write down the same code into `OnExit` of TextBoxA, it is
> working...!!
>
>


0
tina
9/3/2007 4:09:53 PM
Hello Tina,

Related table refers to "RequsitionTable"
TextBoxA - refers to Project Manager who makes the requsition.
TextBoxB- dublicates the Project Manager in the same table

TextBoxA actually receives its data from the related table
(TblProject). (it is combo box actually to prevent user from mistake)

I considered that if the Project Manager will change in the future, I
would like to keep original Project Manager in the dublicated field
(TextBoxB) who made requsition before. Otherwise, when the Project
Manager is changed in the TblProject, all its related data in the
RequsitionTable to be updated automatically including items from very
beginning of the table.

You may help me to build an adequate relationship for this issue?
Because I am aware of that I am breaking some basic rules of the
database approach.

0
mezzanine1974
9/4/2007 7:53:29 AM
Reply:

Similar Artilces:

Category color changes when changing values.
When I copy a chart I get two identical ones. When I change the values of one of the charts and sort the values, Excel changes the colors of the categories to a preset order, so that the color of the biggest customer in chart 1 is not the same as this same customer (let's say now on the third place) in chart 2. Is there a way to prevent this? ...

query with inline dummy table
Is there a way in Access to create a query that contains the table records within the query itself? I want to avoid creating a dummy table and just use values within the query definition. I was thinking about using syntax similar to the insert into statement I would use to populate the dummy table, but I'm not sure if I have a syntax problem or I'm trying to solve an impossible problem. The query I'm thinking of might look something like this: select * from values("test"); -or- select * from ( ("1/1/07","2/1/07","3/1/07","4/1/07&qu...

workaround for non normalized table
I've inherited a database that relies heavily on a non normalized table. Until I can convince the general manager that I can normalize the data without losing any records, I've got to have a workaround for certain situations. Namely, I need to ensure that data is not being badly reproduced at various stages of our operations. I would therefore like to reference the information directly from the main table in order to populate certain information in related tables. In this case, the main table uses [Order Number] as its primary key, and ties it to a bunch of information like ...

How can I Enable a Check Box based on another fields value?
Hi There, I have a form with a disabled check box. I need to enable it when a certain value ("approved") is selected from a combo box. When I am in Form Design View and I have the Check Box selected the Conditional Formatting menu item on the Format menu is greyed out. I am using Access 2003. Can you tell me what I need to do to make this work? Many thanks, David As you've discovered, Conditional Formatting isn't availabe to checkboxes. Try this: Private Sub Form_Current() If Me.YourComboBox = "Approved" Then YourCheckBox.Enabled = True Else YourChe...

Newbie: can't get a calculated value on the form?
I have a table with numbers and a form that shows the numbers. I have a query that takes one of the numbers and mulitplies it. I put a text box on the form from the query result field, but I get a "#Name" error instead of the result. When I run the query, I get the correct result. Help, please? Ed "Ed from AZ" <prof_ofwhat@yahoo.com> wrote in message news:d1e7d27c-11d9-4696-8d19-4c5fdd9dbb89@d70g2000hsb.googlegroups.com... >I have a table with numbers and a form that shows the numbers. I have > a query that takes one of the numbers and mulitplies it. I p...

Is there a wizard to export and match fields?
I would like to export products from my table into a csv that has different field names. Is there a wizard that would allow me to select which fields to export and what fields they match up to in the new file? Instead of exporting a table, create a query and alias the field names to the ones you want in the CSV, then export the query. -- --Roger Carlson MS Access MVP Access Database Samples: www.rogersaccesslibrary.com Want answers to your Access questions in your Email? Free subscription: http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L "ZenMasta" <me...

Field service table structure and field definitions
The 9 SDK does not reference or define the fields or tables for the Field service component. Where can I find this information? I need to move RMA into a data warehouse and am having significant trouble identifying the data flows. Thanks, Will You may want to contact I.B.I.S. They wrote the application. -- Charles Allen, MVP "WS" wrote: > The 9 SDK does not reference or define the fields or tables for the Field > service component. Where can I find this information? I need to move RMA > into a data warehouse and am having significant trouble identifying th...

Comments field
I would like to add some notes for a Payee but the Comments field under the Payee is not big enough. Is this the only place I can makes these type of notes? I want to put in information such as lenght of contract, type of service they provide, costs, etc.... Thank you. No other solutions (in Money) are coming to mind. "Apr" <noreply@mail.com> wrote in message news:u8WcsBuFHHA.3304@TK2MSFTNGP05.phx.gbl... > Is this the only place I can makes these type of notes? Apr wrote: > I would like to add some notes for a Payee but the Comments field > under the Pa...

How to add summary fields to Group Footer in Access Reports?
How do you add a Summary fields to Group Footers in Access? I have a Detail field I want to Sum in the Group Footer in my report. -- Pat Dools ...

How to enter the transaction
Hi, I am using Money 2001 standard edition. I wish to know how to enter a transaction where i have returned an item to the store and got back the cash or as a credit to my credit card account. The way I enter it now show it as my income which is not true. Can anyone help me with this. Thanks Damu --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.745 / Virus Database: 497 - Release Date: 08/27/2004 Enter a transaction with a category exactly the same as what you recorded against the purchase (ie record the credit on the ex...

Error in code exportin tables to excel
I'm tryin to export a table to excel with the code: Private Sub Command4_Click() On Error GoTo Err_Command0_Click Dim stDocName As String stDocName = "F01_UT" DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, F01_UT, "C:\TRY\Tbls", True Exit_Command0_Click: Exit Sub Err_Command0_Click: MsgBox Err.Description Resume Exit_Command0_Click End Sub However, Access displays the message: Compile error : Syntax error What I'm doing wrong? If I want to export more tablas do I have to write more lines (DoCmd.TransferSpreadsheet acExport, acSpr...

VBA code to hide all the tables on form open
I don't want people to use a blank mdb to import my tables. I manually hide them all. However, after running the macro to delete all records and import from .txt, the table become unhide. I do the importation on daily basis. I posted to macro newsgroup and asked way to hide table after importation action macro but got no answer. Maybe it cannot be done in macro? If so, I need VBA code to hide all the tables on form open. Thanks. Hiding your tables won't prevent people from being able to import them into a blank mdb. All they have to do is ensure that they've set the datab...

Graph Data Values
I am trying to create a pick and mix graph that shows forecast spen against actual spend by a selected business area. I somehow want to create a graph on the fly based on the selections fo example: If I choose company one and want to see the contracted data I want th graph to pick up the forcasted contracted Labour, Passthru and Othe and show the combined contracted actuals; See attached; and if i then choose company 2 then graph will pick up the releven ranges? HELP!! Attachment filename: help.zip Download attachment: http://www.excelforum.com/attachmen...

Converting Values to Unicode Characters
The function CHAR converts a value in the range 1-255 to to an ANSI character. Is there a way to convert values in the range 1-65,342 to Unicode characters? -- Gary L. Smith gls432@yahoo.com Columbus, Ohio You can use VLOOKUP but you'll have to create your own lookup table of the unicode characters and I think you'll have to paste it onto the same spreadsheet.... Maybe you can find a lookup table on the internet somewhere that you can easily paste into your spreadsheet. tsides <tsides@intelligentsystemsconsulting.com> wrote: > You can use VLOOKUP but y...

Passing Values from One Form to Another Including a Combo Box
Hi, hope someone can help with passing two values from one form to another by way of a command button. I have spent a week on various code taken from this site, but still no luck. Please ... someone help!! The form I am passing values from is called PATIENT HISTORY-Form. On this form, I need to pass a date from a field called DateSFESigned and I also need to pass information collected from a Combo box, Combo91. The command button is called Command119. The form that the values are being passed to is called Personal Habits- Form. Thank you in advance for any help on this matter. Maurita ...

Status field in POP10500
Can anyone tell me what "0" in the Status field of POP10500 means? I have shipments that show up on my Purchase Order Processing Document Inquiry window with no corresponding invoice. However, when I attempt to match them to a purchasing invoice, I get a message saying, “This line item has been fully received and invoiced, You may continue, or you may delete this line item and enter a different one.” Using Query Analyzer, I see records with a POTYPE of 2 (Invoiced Receipt) matching up to the shipments. However, the "Status" for these two records is "0". Th...

OUTLOOK FIELD NAME
Hi at all!!!I have this problem....I want export my mail from Lotus Notes into Microsoft Outlook 2000. I have the script already available but I don't know the field name of Outlook document. Something can help me??? Bye.... how in the heck did you get that far, i can't figure any of it out ----- giuliano wrote: ----- Hi at all!!!I have this problem....I want export my mail from Lotus Notes into Microsoft Outlook 2000. I have the script already available but I don't know the field name of Outlook document. Something can help me???...

time/date stamp on email
i used microsoft outlook for email. i sent an email to another outlook user and i wanted to find out if he's read it or not. is there any way to view the time/date that the person reads the email ? if you requested a read receipt and if the recipient uses a program that is capable of replying, yes. otherwise, no. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchang...

Sharing chart on two pages
Hello, I have a worksheet where I put some datas and then under this datas is a chart. Place taken by this data isn't static - once there is more datas and the other time there is more datas. I have problem with this chart, because sometimes chart is shared between two pages on printing. Is there a possibility to use something like property "keep together" in crystal reports where object is printed whole on one page (if there is no enough place it's started pritnting on next page)? Maybe somebody knows how to do it in macro if there is no appropriote property -- Bes...

dynamically filtered pivot table
I'm trying to make a pivot table that will dynamically hide a section o its contents based on a boolean operator the user can set. Becaus this boolean is used in several places, I don't want to require th user to manually set the visibility parameters for the pivot table. It seems like the only way to do this effectively is to have th booleans set by a button, and have the button not only toggle th boolean, but also change the visibility in the pivot table. here's the code i've tried: Sub ToggleButton1_Click() If ToggleButton1.Caption = "Include" Then 'C...

Exporting a table from Access 2003 to Excel 2007
I am trying to export a table from Access 2003 with more than 100,000 records into Excel 2007 and am not having any luck. I do not find the 2007 file extension in the drop down and choosing the latest version only exports part of the table. Any thoughts on whether this is possible to do? -- Carol Hi Carol, This is even hard to do with Excel 2007. You won't be able to do it directly with Excel 2003. You could export the file as a comma separated value with a csv suffix. By default Excel usually opens csv files. However you may lose formatting and other stuff. I ju...

Text in pivot table limited to 255 characters
I am using a pivot table as an efficient way to aggregate text responses from a large data set. However, the pivot table cuts off the text after the first 255 characters (similar to when you copy a worksheet by using the move/copy option). How can I overcome this? I have tried putting the pivot table on the same sheet as the dataset, but that does not work. I should also note that these pivot tables are then fed into an automated report through a complicated set of VLOOKUPs, etc. The pivot table aggregates several questions and responses from many areas of the datset into one discr...

Moving fields on extender windows
Hi! Can someone tell me how I can move the fields on the extender windows? -- Marisol Mortera Because of the way Extender stores data, you cannot move fields like you would using Modifier. You need to go to the Extender windows design and set up another field with the information. Then you will need to move data behind the scenes from the existing field to the new field. Alternatively, you could export the data; delete the data in the window; and import it. "Marisol" wrote: > Hi! > > Can someone tell me how I can move the fields on the extender windows? > -- &...

ENTER button
Isn't there a way to make it so that if you're entering data and tabbing over several columns as you go, that after you hit ENTER the box moves down one row and to the first column that you began entering data into Thanks! Here is one I use that goes back to the original column and one row down. I use the right arrow key. right click sheet tab>view code>insert this>modify to suit. Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) If Target.Row > 5 And Target.Column = 8 Then ActiveCell.Offset(1, -6).Select End Sub -- Don Guillett SalesAid Software donald...

Printing Custom Forms and Exporting Custom Fields
I want to design a custom form and place it in the Public Folder for use by multiple users. Two problems: 1) unable to print custom forms 2) understand that data from custom fields cannot be exported into another application I need to export the data for management reports. Any suggestions? I am not a programmer, but have had some success working with VBA in Excel. Info on the microsoft sites appears stale. We have Outlook 2002 and Microsoft XP operating system. Thank you very much. ...