form creating new row in table1, looking for field value in table

Please can someone help as I have been battling all week with this problem, 
and haven't had a response.

I have a form which uses some data from table1 to create an entry in table2 
(i know duplication is bad, but as this is a live database, and i am working 
on a new section, this makes this complicated task easier), which works fine. 
however, i have a third table that has the unique ID from table1 and table2 
in order to show when a table1 row of data is needed in table2 via a 
checkbox. This third table3 is created when elsewhere.

The problem lies with bringing in the unique ID value from table2 and puting 
it in the same row as the unique ID value from table 1, into table 3. eg:

table1
UID = 12345

table2
UID = 6789

table3
UID = 1
tbl1-UDI = 12345
tbl2-UDI =

the code i use when opening the form is as follows: (text126 pulls the value 
of UID1)

Dim badger As String
Dim LinkID As Long

badger = Me.NameData & ";" & Me.dteStartDate & ";" & Me.dteEndDate & ";" & 
Me.Text126

DoEvents
LinkID = DLookup("UID2", "table3", "[UID1]=" & Me.Text126)

On Error GoTo ErrorHandle
    DoCmd.OpenForm "frm_TRA_AddBooking", , , "[NameData ]=" & Me![NameData], 
acFormAdd, , badger 

I am guessing it is something to do with the form creating an autonumber for 
table2, and not being able to use that value until after the form is closed, 
however I have tried passing over the value to a second form, and that does 
not pass it over either.(text54 calls the value of UID2 which pulls from the 
table)

Dim DayDataInfo As String

DayDataInfo = Forms!frm_TRA_AddBooking!UID2;" & 
Forms!frm_TRA_AddBooking!UID1;" & Forms!frm_TRA_AddBooking!Text54

DoCmd.OpenForm "frm_TRA_DayData"

I would be very grateful if someone would help me with this (providing I 
have explained it clearly enough)
0
Utf
5/25/2007 8:57:01 AM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
998 Views

Similar Articles

[PageSpeed] 5

Don't worry, I fixed it via some tweaking elsewhere, and by passing the 
openargs over in the correct bit.

"OTWarrior" wrote:

> Please can someone help as I have been battling all week with this problem, 
> and haven't had a response.
> 
> I have a form which uses some data from table1 to create an entry in table2 
> (i know duplication is bad, but as this is a live database, and i am working 
> on a new section, this makes this complicated task easier), which works fine. 
> however, i have a third table that has the unique ID from table1 and table2 
> in order to show when a table1 row of data is needed in table2 via a 
> checkbox. This third table3 is created when elsewhere.
> 
> The problem lies with bringing in the unique ID value from table2 and puting 
> it in the same row as the unique ID value from table 1, into table 3. eg:
> 
> table1
> UID = 12345
> 
> table2
> UID = 6789
> 
> table3
> UID = 1
> tbl1-UDI = 12345
> tbl2-UDI =
> 
> the code i use when opening the form is as follows: (text126 pulls the value 
> of UID1)
> 
> Dim badger As String
> Dim LinkID As Long
> 
> badger = Me.NameData & ";" & Me.dteStartDate & ";" & Me.dteEndDate & ";" & 
> Me.Text126
> 
> DoEvents
> LinkID = DLookup("UID2", "table3", "[UID1]=" & Me.Text126)
> 
> On Error GoTo ErrorHandle
>     DoCmd.OpenForm "frm_TRA_AddBooking", , , "[NameData ]=" & Me![NameData], 
> acFormAdd, , badger 
> 
> I am guessing it is something to do with the form creating an autonumber for 
> table2, and not being able to use that value until after the form is closed, 
> however I have tried passing over the value to a second form, and that does 
> not pass it over either.(text54 calls the value of UID2 which pulls from the 
> table)
> 
> Dim DayDataInfo As String
> 
> DayDataInfo = Forms!frm_TRA_AddBooking!UID2;" & 
> Forms!frm_TRA_AddBooking!UID1;" & Forms!frm_TRA_AddBooking!Text54
> 
> DoCmd.OpenForm "frm_TRA_DayData"
> 
> I would be very grateful if someone would help me with this (providing I 
> have explained it clearly enough)
0
Utf
5/25/2007 9:31:01 AM
Reply:

Similar Artilces:

how to convert lookup values to the "display text"
I'm using an sql code (below) which uses a few lookup fields. Unfortunately in the datasheet view, I get the "bound values" instead of the "display values". How can I change the properties for the these lookup fields so I can see the "display values" from the datasheet view? SELECT [Funding],[Date],[Description],[Company],[Expense_Type],[Amount],[Status] FROM [Form_9_Status] UNION ALL SELECT [Funding],[Date],[Description],[Company],[Expense_Type],[Amount],[Status] FROM [TDY_Status] UNION ALL SELECT [Funding],[Date],[Description],[C...

New Implementation
I have following queries regarding new implementation: 1) If I ask that I have 8 outlets at remote locations & these are all garments stores, which will communicate with HQ Server. Each store is having around 1500 items. Now the question is how much time/days will it required to implement? Can anyone tell me an approximate time period? Just have an idea. 2) Which connection/line is fast/speedy for communication with HQ server from remote stores? Like DSL, Dial ap. IS VPN necessary?If NOT Y and if YES Y?? 3) Initial Steps ======= •Will start from Store Operation Template Database. •Af...

Autonumber created.. problems in the future?
I managed to create an autonumber in Microsoft CRM. I did this by making a field "Number"(in the database "New_Number") and I published it on the form. Then I went To the SQL server and I changed the field in the table to Identity Yes, Identity seed 1, Identity Increment 1. I locked the field on the form. It worked! I think that this is not supported by Microsoft. But has anybody got any idea which troubles i could get with this configuration? San ________________________________ Do you know all add-ons for Microsoft CRM? Visit http://www.pimpmycrm.com The biggest dange...

hide a row
I have a worksheet with information in column A and B. If Column B has no information I want to do nothing, but if there is something in Column B, I would like to hide the row. Is this possable in an if statement? Hi not possible with a formula. This would require VBA -- Regards Frank Kabel Frankfurt, Germany "Bob" <bobolah@hotmail.com> schrieb im Newsbeitrag news:OSOK8hisEHA.2556@tk2msftngp13.phx.gbl... > I have a worksheet with information in column A and B. > > If Column B has no information I want to do nothing, but if there is > something in Column B, ...

New to excel
Hi All, I'm new to Excel ( and to this forum :) ) and so I hope somebody may b able to help me. I've got 2 questions.... QUESTION 1 I've got a spreadsheet which takes data from one worksheet and uses i to calculate data in a second worksheet using the following code formula: =IF('4th November 2005'!B19="","nothing here dude",IF(B19<'4th Novembe 2005'!B19,"UP",IF(B19='4th November 2005'!B19,"Same",IF(B19>'4t November 2005'!B19,"DOWN")))) The problem is, when I create a new worksheet I have...

Looking for Excel Help
I'm a very novice Excel user and am looking for a little help with creating a formula for a spreadsheet I'm creating for my personal use. I would appreciate some assistance if possible. Thanks in advance. Dan --- Message posted from http://www.ExcelForum.com/ Hi Dan! Post a sample of what you want to do. Your question is just a tad open ended <g> -- Regards Norman Harker MVP (Excel) Sydney, Australia njharker@optusnet.com.au Excel and Word Function Lists (Classifications, Syntax and Arguments) available free to good homes. "DanB4105" <DanB4105.ywtpa@excelfor...

Attaching Contacts to new email
Creating a new email. When contacts folder has "shared" contacts and "personal" contacts how can you set your personal contacts as the default? Example: creating a new email having never addressed the "send to" contact before, you hit the "To" button. Currently my "shared" contacts opens up but I would like my "personal" contacts page to open instead of having to drop down to "contacts" to bring up that list. Is there a solution to this? Thank you!!! On 2/26/2010 10:21 AM, assistantneedshelp wrote: >...

Auto transfer of row
I have a list of components to be ordered in each row is a cell with order number entered in it. What I want is to copy the row to anothe sheet (which is to be displayed at goods) when the order number i entered in that cell. Is this possible? many thanks for any help -- alanle ----------------------------------------------------------------------- alanled's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3094 View this thread: http://www.excelforum.com/showthread.php?threadid=57297 this could be acheived by using VLOOKUP function. if you want a perfect soluti...

How to delete a set of rows depending on Value
I have two worksheets Worksheet A 27 Columns 1600 Rows. Worksheet B 1 Column 200 Rows I need Worksheet A to look at each cell in Worksheet B, if a cell exists in Worksheet A, then I need the row deleted... Basically I have a list of Grand list of items to do, then a list of items already completed. I need to now remove all entries in the grand list that have been completed. Is this feasible or should I look at using some Unix script. It sounds like you could use VLOOKUP to find out if the value in B exists on A: http://www.officearticles.com/excel/vlookup_formulas_in_microsoft_excel....

How to create an autonumber field?
hi i need to create an autonumber field to automate account numbering. how can i do this? thanx You can do this using a post callout piece of code so when you update an account this code is called which calls back into the platform and works out the last account number then adds one to it and updates the account record. look on msdn.microsoft.com under crm for examples -- John O'Donnell Microsoft CRM MVP http://www.mscrmfaq.us "Max" <Max@discussions.microsoft.com> wrote in message news:0ABFF244-EC0A-48EC-9E76-7CA61E6EBC3A@microsoft.com... > hi > > i need ...

How do I overlay text to a row without loosing the text in the ba.
I would like to know how to give an entire row (or column) a text overlay such as "VOID" and still be able to view the text in the underlaying row (or column). Thanks in advance. Use WordArt from the Drawing toolbar. Change the Fill to None. -- Jim Rech Excel MVP "Bruce Charles" <Bruce Charles@discussions.microsoft.com> wrote in message news:C430F6BC-1EBD-461F-A3FA-EC8592C5704C@microsoft.com... |I would like to know how to give an entire row (or column) a text overlay | such as "VOID" and still be able to view the text in the underlaying row (or | c...

How do I see when new messages without outlook running?
Without Outlook 2003 constantly running, how do I send mail or know when I have new mail? two possible answers... 1) you don't or 2) you acquired a 3rd party app to occasionally poll your pop3/imap account "Leslie Adams" <Leslie Adams@discussions.microsoft.com> wrote in message news:D37C11C7-722C-4E91-9393-735A49C11701@microsoft.com... > Without Outlook 2003 constantly running, how do I send mail or know when I > have new mail? ...

Pivot Table Question #5
How do I make the row headers show up in front of each row on pivot table instead of just once on the first row of a section? Thanks Try this: Copy the pivot table Do a Paste Special > Values into another sheet Ensure that the top left cell is A1 Run the Sub FillBlanks() below (from MVP Debra D) Sub FillBlanks() 'by Debra Dalgleish 7-Dec-2001 'fill blanks cells with data from above Range("A1").CurrentRegion _ .SpecialCells(xlCellTypeBlanks) _ .FormulaR1C1 = "=R[-1]C" Range("A1").CurrentRegion.Copy Range("A1").PasteS...

'top' is not a valid value for the 'vertical-align' property.
Well, it is, actually, and the resulting .chm file works properly in HTML Help. But it's a bit tedious getting that wrong useless error message from VS2002 on every build. (Well, not every build, it only does it sometimes actually.) Any idea how I can persuade it to stop telling me this? -- Tim Ward Brett Ward Limited - www.brettward.co.uk ...

New Record
I'm using the following in the On Click of a command button. DoCmd.GoToRecord acDataForm, "frmMyForm", acNewRec Anyway I can do this without referenceing the Object (Form) name?? James James, Yes... DoCmd.GoToRecord , , acNewRec God Bless, Mark A. Sam "JamesJ" <jjy@adelphia_darwin.net> wrote in message news:er2loxDPIHA.1208@TK2MSFTNGP03.phx.gbl... > I'm using the following in the On Click of a command button. > > DoCmd.GoToRecord acDataForm, "frmMyForm", acNewRec > > Anyway I can do this without referenceing the Object (Form)...

explanation of codes in Visual Basic when creating User form
Hi, I am trying to create a user form in Visual Basic however I'm trying to teach myself by reading/watching tutorials. (www.contectures.o.ca, etc) A lot of the instructions I am seeing simply give the code rather than explain how to actually write one from scratch. So... I need to know what each 'term' means so I can understand how the codes work. Any help is much appreciated :) One of the first codes is for the Add button Private Sub cmdAdd_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("PartsData") What d...

Certain Keys/Characters not recognised when creating a task
I've just attempted to create a task and the edit control for the subject of the task refused to accept the characters c h s t u and v. I was able to switch to other applications such as a command prompt and internet explorer and type the characters quite happily (so there is nothing wrong with the keyboard) but when I switch back to Outlook it will not recognise them. I'm using Outlook2003 as installed with Office 2003 Professional (SP1 and all other updates applied). As a last resort I closed down Outlook and restarted the program which is now accepting the keys/characters. A...

get a result of an sql into a field
Hi there I would like to get a result of an sql execution (ms sql server) into aq filed. example i A1 I have a ID number in A2 I would like to get the result of something like this 'select name from address where id=A1' Does this exist in Excel ? Thanks in advance Ralf Here is the sub i have written for loading an Sql Query into th worksheet. Parameters: Server Name DataBase Name SQL Command Target Sheet name Column to begin from Row to begin from ex: CALL LoadData("MyServer","MyDataBase","Select UserName fro TblNames", "QueryData"...

How to automate increasing the form cache registry/file etc...
I want to roll out a batch file to make a number of tweaks to CRM The body of it would go REGEDIT /S Kerberosefix.reg REGEDIT /S ForceFormreload.reg REGEDIT /S OutlookFix.reg It would also rename OSA.exe to OSA.bad Remove OSA.exe From the startup menu I need help finding a way to use my batch file to increase the Outlook Form cache from the default 4MB to 50 MB.. This makes CRm more stable and faster for communications. I dont want to manually do this, as it time consuming, are my end users would not be reliable in doing it themselves. I also want to make another batch file or button that...

default values in a cell
Hello, can you help me please Cell B1 contains a complex mathematical formula which requires (in several places) a number from cell A1. Cell A1 can contain any integer number, but it is usually the same (30). I would like to be able to leave cell A1 empty, and only enter a number when it is not 30 , ie the default value of A1 is 30, unless specified. How do I go about this ? Should I look at conditional formatting, or put lots of IF functions into an already complex formula? Thank as always KK Use 2 cells Modify the complex formula to use B1 rather than A1 ( or any other un-u...

Average of absolute values of moving ranges
I'm trying to get the average of the absolute values of a set of data over 8 weeks. Each week is on a seaparate sheet so to capture the moving ranges I've been using the formula below to get my result. Is there an easier way? =AVERAGE(ABS('Week 1'!G2-'Week 2'!G2),ABS('Week 2'!G2-'Week 3'!G2),ABS('Week 3'!G2-'Week 4'!G2),ABS('Week 4'!G2-'Week 5'!G2),ABS('Week 5'!G2-'Week 6'!G2),ABS('Week 6'!G2-'Week 7'!G2),ABS('Week 7'!G2-'Week 8'!G2)) Thanks! Amy The use of t...

Load image in a unbound control from a attachment field in recor
I have a unbound (single not continuious) form with 16 differant records from the same recordset. No problem loading the this data from recordset in VBA. PROBLEM I need to know how to load the unbound controls with Image's from an attachment field in another recordset The normal method of control = Rs!field does not work Please advise -- Thanks Tom dans l'article 78DC5502-3A76-4562-AA20-736446AB1448@microsoft.com, Tom � Tom@discussions.microsoft.com a �crit le 21/01/08 20:28�: > I have a unbound (single not continuious) form with 16 differant records from > the same record...

Table of Contents for each section
I have tried several times to create a TOC for each section of my document. They way it is now I can simply go to the Insert a TOC and it will insert e perfect TOC. All my text has been changed to the appropriate Level and I have no problem there. But I need to seperate the chapters to the start of their respective sections (I have next page breaks inserted at the start of every chapter). I have tried the bookmark method, no luck. I have tried other methods but I think my problem is that I have selected the appropriate fields and changed their levels appropriately. I have not mes...

form fields not saving to table
I have created a database with a form and three of the fields are not saving the information to the table. I have checked the row and control sources and now at a loss and thoughts? As you scroll through existing records is the data of the table displayed? Post the SQL of the query or form source. -- Build a little, test a little. "Kim" wrote: > I have created a database with a form and three of the fields are not saving > the information to the table. I have checked the row and control sources and > now at a loss and thoughts? > > ...

Status in table PurchaseOrderEntryDetail
Hello, We're trying to populate serial # into the PurchaseOrderEntryDetail table and run across the column 'Status'. What are the possible values for Status column in this table? Most of the time we see status of '2'. What does that mean? Please help. Many Thanks & Best Regards, Nikki ...