473,626 Members | 3,369 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to select a row from a pop-up form for record import?

57 New Member
I am trying to import Excel files that contains names and stock id's. The format is something akin to this:

Stock Description -- Players
1991 Topps #145 -- Frank Thomas/Sammy Sosa/Cal Ripken

My 3 tables are
  • tblStockHeader with Stock_ID (auto#), Stock_Descripti on
  • tblPlayerHeader with Player_ID (auto#), Player_Name, Player_DOB
  • tblStockPlayer with SPlayer_ID (auto#), Stock_ID (long), Player_ID (long)

My goal is to create lines in tables that will normaize the data involving the players as more than 1 can show up in the Excel file for the same Stock_ID. I've gotten that far with no problems so I'm more challenged by there might 2 players named the same thing (think 1960's Frank Thomas and 1990's Frank Thomas) and my Excel files won't know which is which.

So what I'm trying to do is when I import, VBA will dcount the # of Player_Names that match and if it's 0, it'll add the player to tblPlayerHeader and then add the player_id to tblStockPlayer, if it's 1, it'll just add the player_id to tblStockPlayer and if it's 2 or more, it'll open a form of potential matches for me to select which one to then add to the tblStockPlayer.

I truly don't know what direction to go in order to get the form of options to popup and then select/carry back to my original vba process the selected data.

Here is what I have. Please note that GetCSWord(strAS tring, I) is the broken-out Player_Name from the multiple potentials.

Expand|Select|Wrap|Line Numbers
  1.  
  2. For I = 1 To intCnt
  3.  
  4. searchcount = DCount("[Player]", "TestPlayerHeader", "[Player_Name] =""" & GetCSWord(strAString, I) & """")
  5.  
  6.     Select Case searchcount
  7.         Case 0
  8.             MsgBox "Need a new record"
  9.         Case 1
  10.             MsgBox "Only Record"
  11.         Case Is > 1
  12.             DoCmd.OpenForm "TestPlayerHeader", acFormDS, , "[Player_Name] =""" & GetCSWord(strAString, I) & """"
  13.     End Select
  14.  
  15.     Next
Jan 6 '11 #1
1 1354
HSXWillH
57 New Member
Repost: I've gone in a different direction and have some sample data that I'm not able to get DLOOKUP to work properly with.

My table, TestPlayerHeade r has the fields of Player_ID (auto random #), Player (text) and DOB (date). Player and DOB are keys to limit unique records.

I have put some sample information in.

#### --- Edison --- 1/1/2000
#### --- Jones --- 1/1/2000
#### --- Jones --- 1/1/2001

My code to pull and find the Player_ID of the player + his DOB is as follows. I keep getting an Run-Time Error #6 -- Overflow error but there is not more than 1 record being pulled based on the conditions.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "TestPlayerHeader", acFormDS, , "[Player] =""" & GetCSWord(strAString, I) & """"
  2. searchdob = InputBox("Enter a birth date.", "Birthdate Entry")
  3. searchid = DLookup("[Player_ID]", "TestPlayerHeader", "[Player] ='" & GetCSWord(strAString, I) & "' AND [DOB] =#" & searchdob & "#")
  4. MsgBox searchid
What coding am I doing wrong here? I want the unique Player_ID and there should be only an unique one based on the information I've entered.
Jan 13 '11 #2

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

Similar topics

4
4690
by: Andre | last post by:
Hi guys, newbie question. I am having trouble with a script that is supposed to login me to my account on yahoo pop server. When i do this: import getpass, poplib, re POPHOST = "pop.mail.yahoo.com" POPUSER = "mylogin" POPPASS = "mypass" pop = poplib.POP3(POPHOST)
6
23193
by: Will | last post by:
Hi, Sorry to be a pest... But I can figure this out. I'm pushing to a stack. then I need to check to see if the word is a palindrome. Is the code below correct? if so, how can I check the entire word?
3
3027
by: Max Weber | last post by:
Try to run the code below in a page. You will notice than when you switch the multiple attribute of the SELECT tag, only one option is displayed as selected although multiple options have ben created as selected. May somebody give me an explanation ? <input type="button" value="test" onclick="test()"/> <select name="tagSelect" style="width:100%"> </select>
15
4147
by: Stig Brautaset | last post by:
Hi group, I'm playing with a little generic linked list/stack library, and have a little problem with the interface of the pop() function. If I used a struct like this it would be simple: struct node { struct node *next; void *data; };
10
2798
by: Martin Holm Pedersen | last post by:
Hey All.. Im having a bit of a problem with my program that i wrote for linux in c. I use select() to monitor if the user has pressed a key and reads the key with read(). It works fine om my IBM laptop but once i move the program to my dell laptop it seems like it doesn't even recognize the select-function. That is, it doesn't use the timeout assigned at all. I don't get any errors when i compile on either computer. I run debian/testing on...
25
4189
by: Nicholas Parsons | last post by:
Howdy Folks, I was just playing around in IDLE at the interactive prompt and typed in dir({}) for the fun of it. I was quite surprised to see a pop method defined there. I mean is that a misnomer or what? From the literature, pop is supposed to be an operation defined for a stack data structure. A stack is defined to be an "ordered" list data structure. Dictionaries in Python have no order but are sequences. Now, does anyone know...
10
2249
by: mjpdatadev | last post by:
I am relatively new to XMLRequest, DOM and Ajax but I really like the functionality. I have the DIV and SPAN changes working well but I thought that I would experiment with changing the actual innerHTML of each control rather than changing the whole control inside of a DIV. What I tried was this: Create a <SELECTso... <SELECT id=MyComboBox> <OPTION>opt1</OPTION>
7
24930
by: Scott | last post by:
As said before I'm new to programming, and I need in depth explaination to understand everything the way I want to know it, call it a personality quirk ;p. With pop() you remove the last element of a list and return its value: Now I know list is a bad name, but for the sake of arguement lets assume its not a built in sequence> 'example'
1
4323
by: Mikle | last post by:
I need to update values in a table (where they are null or zero) with values from another table for the corresponding PopulationMemberID. Now I now that you can't update where there is a join.. but the join is in the nested select.. so it should work right? CurrentDb.Execute ("UPDATE Samples SET samples.SampleMemberEmployees=(SELECT pop.PopMemberEmployees FROM population as pop WHERE .=. ) WHERE nz(sampleMemberEmployees,0)=0 AND
1
1006
by: abhishekbrave | last post by:
I want to create a menu in left pannel of HTML page. Each menu item will have different sub menu items. My requirement is that whne a user select or click on a menu item the sub menu items should pop down and the rest of the menu items should shift below. Is this requirement is achievable wih the help of java script . If yes, then any pointers will be very helpful.
0
8196
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8705
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4197
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2625
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.