473,322 Members | 1,398 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,322 software developers and data experts.

Setting record set within a form with multie criteria

52
I am truly stuck and need some help on how to put this form together; any help or suggestions you can provide would be greatly appreciated. (Sorry this one is so long but I believe it is necessary to have this info so you can see what I am attempting.)

I have been tasked with a project where my users want to be able to enter several pieces of data which I am currently tracking within two tables. Please keep in mind that these tables are being expanded regularly (whenever they get an idea) and may not be set up efficiently as they could. Case in point would be my Custom_Code table where we are tracking Project_Name and Element_Name (which is actually a sub Project of the Project_Name). I know we should have split the information into two tables but I was truly in to deep when they dropped this on me. So, as you can guess; I am truly tracking a Many to One within this table for a Project_Name can have several Element Names within. I’m hoping I can work around this, with your help that is.

[IMG]

[/IMG]

I also have a table named Expected_Release which will track the release numbers for the above projects.

[IMG]

[/IMG]

I have created the below form which I’m hoping to be able to use for modifications, creations, and or deletes. The problem I’m having is; how do I populate the form with the information that is narrowed down from the two combo boxes Project_Name and Element_Name?

My form looks like:

[IMG]

[/IMG]

As you can see the Project_Name is a combo box where I have a select behind it populating it with all valid Project_Names from within Custom_Code table. I then want to drill down further therefore I have the Element_Name combo box which I also have a select behind it that only shows records that are associated to the Project_Name they have selected prior. Again the issue I am having is I don’t know where to go from here? How do I get the record set to populate the rest of the fields, keying off of the two options they had selected? One thing I should note is that there are Project_Names within the table that do not have any Element_Names associated with them, therefore the Element_Name can be Null.

I thought it would be as easy as writing a select to populate the ID text box within the form but I am unable to figure out how to update this object. And, I am unsure how I could get the form to reset itself even if I was able to update it? (I’m thinking that I am way off base with this concept.)

Any help and or guidance on this project would be greatly appreciated.
Birky
May 29 '07 #1
1 1504
Birky
52
I was able to figure it out....

Expand|Select|Wrap|Line Numbers
  1. Private Sub Element_Name_AfterUpdate()
  2. Dim strSQL As String
  3. Dim intID As Integer
  4.  
  5.     intID = DLookup("ID", "Custom_Code", "([Project_Name]='" & Me!Project_Name & "') AND ([element_Name]='" & Me!Element_Name & "' )")
  6.     strSQL = "Select * from [custom_code] where [ID] = " & intID
  7.     Me.RecordSource = strSQL
  8.     Me.DataEntry = False
  9.     Me.Requery
  10.  
  11. End Sub
  12.  
May 29 '07 #2

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

Similar topics

2
by: John Hargrove | last post by:
I'm having trouble setting decimal place values in the results field of a sample management database I'm building for an environmental testing laboratory. The degree of sensitivity varies among...
2
by: Lyn | last post by:
If I have a form where the RecordSource property is set to the name of a table, then on opening the SingleForm form I can cycle through all the records in the table one at a time via Next and...
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
11
by: Zlatko Matiæ | last post by:
Hello. I have a MS Access front-end working with PostgreSQL database. I have successfully created saved File DSN. My paa-through queries are referring to that file as well as linked tables. But I...
22
by: Br | last post by:
First issue: When using ADPs you no longer have the ability to issue a me.refresh to save the current record on a form (the me.refresh does a requery in an ADP). We usually do this before...
6
by: jim | last post by:
Is anyone able to provide me with a link to useful documentation or just outright explain to me how to set query parameters dynamically? I'm really new to Access and databases in general but I...
8
by: Sid | last post by:
I hope someone could help me with this. I am trying to setup a criteria to decide when to allow/not allow user to click on the check box. logically it looks simple but I am not able to...
2
by: willyc | last post by:
Hello all, hopefully you will kind enough to offer some assistance.... I want to make what i believe could be quite a complex query, something beyond the 'basic' access queries. I'm not afraid of...
2
by: angi35 | last post by:
I hope this is an easy question for someone out there. In Access 2000…I have a MainForm with a tab control (MAIN TABS) with 7 tabs. Within each tab is a SubForm. Within each SubForm is a tab...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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)...
1
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.