473,326 Members | 2,126 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,326 software developers and data experts.

Link records in different forms

I am very new at this and find myself lost in the numerous possibilities Acces has to offer, some help with the folowing problem would be very nice.

I have created 2 forms, named 'Contact List' and 'Contact Details'. The form Contact List, has a subform with a table: 'Contact subform', which displays all the contacts in a table. I also created a button (in the subform) to go from the list to the details, now I would like to go to the record that is selected in the subform's table.

Thank you!
Kind regards,

Philippe
Aug 7 '08 #1
10 3027
NeoPa
32,556 Expert Mod 16PB
Are you trying to go to the specific record within the full list? Or would filtering the [Contact Details] form be more appropriate? That way ONLY the relevant record would be opened in the form.
Aug 7 '08 #2
That is a good question. It would give more possibilities if the user still has the possibility to navigate between the records after the specific record is opened. So I guess that makes it more difficult to work through a filter. I was thinking more in the direction of introducing a 'go to record' action with appropriate conditions, but which I would not know how to define. Is this a possibility?

Thank you!

Philippe
Aug 7 '08 #3
NeoPa
32,556 Expert Mod 16PB
I think so Philippe.

However, allowing that extra operator flexibility may well prove a problem. If the operator always navigates via your main form the situation will be more predictable, which will probably make the project more stable.

But let me know if you still want the ability to navigate between records on a form, and also if this will need to be invoked remotely (as in from the OTHER form).
Aug 7 '08 #4
I guess you are right and that I could reduce navigating possibilities to the main form. So when 'Contact Details' are asked for the selected record, they show up as a 'pop up' which can easily be closed again.

Could you help me with the filter settings though? Should I use a macro to solve this problem?

Thank you!


I think so Philippe.

However, allowing that extra operator flexibility may well prove a problem. If the operator always navigates via your main form the situation will be more predictable, which will probably make the project more stable.

But let me know if you still want the ability to navigate between records on a form, and also if this will need to be invoked remotely (as in from the OTHER form).
Aug 7 '08 #5
NeoPa
32,556 Expert Mod 16PB
I can help - and lead, but I can't do it for you.

Get it started and let me know what you can do and where you get stuck.

If I'm to help though, you will probably need to be more clear and precise in your communications. This isn't just you - this applies to most people. Trouble is, working via a web page is a lot lot harder than working on a database you can see, so I need all the clues you can give me to understand where you are.
Aug 7 '08 #6
Dear NeoPa,

If you could get me started, it would be of great help.
I will try to explain - the best I can - what I am trying to do:

I have a main form (Contact List) with a subform (Contacts subform). This subform has a table in it displaying the fields (ID, Company, Last Name, First Name) of my table. The ID is basicily an autonumber for each record.

Now I would like to create a link between the main form and another form (Contact Details). When the user clicks on the ID of a record in the subform (example: number 5) the Contact Details form should open on this same record (5).
Basicily, when clicked on a contact, the contact details should 'pop up'.

Is this possible? I have searched the internet and forums for a similiar case, without any results. How should I get started?

Should I write a macro with an open form action, folowed by an apply filter action? I have tried this but got stuck defining the filter.

Thank you in advance!
Kind regards,

Philippe
Aug 8 '08 #7
hjozinovic
167 100+
Hi P.

I would use double click on ID in subform to open a pop-up in order to avoid unintentional openings.
In double click event of ID field in subform you could put a code doing this:
Expand|Select|Wrap|Line Numbers
  1. Store the value of current ID in a variable
  2. Open a pop-up form with details
  3. Move focus to ID field on pop-up form
  4. Docmd.FindFirst .....(find a value stored in a variable)
Aug 8 '08 #8
NeoPa
32,556 Expert Mod 16PB
Firstly, H makes a good point about using Double-Click to trigger the code.

Next, you start by designing a form (Contact Details) to display the data from the table you need to display. The design of the form will be unrestricted and will show (when not filtered) all records in the table.

This form should have the .PopUp property set to True if you want it as a Pop-Up.

In the Double-Click event procedure for your control where [ID] is shown, have something like :
Expand|Select|Wrap|Line Numbers
  1. Private Sub ID_DoubleClick()
  2.   Dim strFilter As String
  3.  
  4.   strFilter = Replace("[ID]=", "%I", Me.ID)
  5.   Call DoCmd.OpenForm(FormName:="[Contact Details]", WhereCondition:=strFilter)
  6. End Sub
Aug 8 '08 #9
Thank you for your help!

I tried your code, it opens the contact details form, but not on the right record (where I double clicked on)

I tried almost anything, but no results so far.
This is my final code, could you take a look at it please?

Expand|Select|Wrap|Line Numbers
  1. Private Sub ID_DblClick(Cancel As Integer)
  2.  
  3.     Dim strFilter As String
  4.     Dim lngrecordnum As Long
  5.  
  6.     lngrecordnum = frm.CurrentRecord
  7.  
  8.     strFilter = Replace("[ID]=", "%I", lngrecordnum)
  9.  
  10.     Call DoCmd.OpenForm("Contact Details", acNormal, strFilter)
  11.  
  12. End Sub
Thanks!
Aug 8 '08 #10
NeoPa
32,556 Expert Mod 16PB
I had an error in the code I posted - but you also didn't copy it properly.

Try with this :
Expand|Select|Wrap|Line Numbers
  1. Private Sub ID_DoubleClick()
  2.   Dim strFilter As String
  3.  
  4.   strFilter = Replace("[ID]=%I", "%I", Me.ID)
  5.   Call DoCmd.OpenForm(FormName:="[Contact Details]", WhereCondition:=strFilter)
  6. End Sub
Aug 8 '08 #11

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

Similar topics

11
by: Drew | last post by:
I would like to explore some different ways to build a link out of the following string from a db, Fiscal; swvtc/fiscal/fiscaldata.asp: Records; swvtc/records/recordsdata.asp: Which is just a...
6
by: Robin S. | last post by:
**Eric and Salad - thank you both for the polite kick in the butt. I hope I've done a better job of explaining myself below. I am trying to produce a form to add products to a table (new...
3
by: Richard Hollenbeck | last post by:
I have the following query in my form's code: Private Function Get_Data(fieldNum As Integer) Dim strSQL As String Dim db As DAO.Database Dim rs As DAO.Recordset strSQL = "SELECT & "", "" & ...
9
by: Sandy | last post by:
Hi all, I have a form to list records (frmListIssue) which I call from different other forms. My wish is to display a message when the form is called and empty; no records to display. I want to...
2
by: joan.edington | last post by:
Hi, I've not done a lot of MS Access work and have been tasked with creating a database to record and report on stages of complaints cases. Each set of records for a case has a header, any...
13
by: Steve | last post by:
Hi; A friend of mine is publishing a book that includes 3000 citations, many with urls. When he made his bibliography he chopped off the "http://"s off of his urls. I wrote a program to...
1
by: NumberCruncher | last post by:
Hi All, I am struggling with setting up my first system of tables, forms,and reports, and could use your help! I am setting up a database to keep track of the production of a produced item. The...
1
by: royal084 | last post by:
i need to make 4 different forms in 1 project in borland C++ Builder.forms r different but there is some similar tasks of them.so i made a common base form with similar tasks and all codes of similar...
1
by: Doug | last post by:
What is the simplest way to make a report where only the records where a field matches a certain date are included, and the user first selects that date (from form or popup)? (I can write the SQL...
17
beacon
by: beacon | last post by:
Hi everybody, I'm working with data to determine if records were completed in a given timeframe. I'm trying to figure out how I can assess records with the same ID, but have different data in...
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...
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: 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...
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.