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

Help with forms

11
Im trying to create a database for a visitor logging system. Basically, if the visitor has never visited before, he or she must be entered into the database and "signed in". All of the visitor details are stored in a "visitors" table. Here's where the problem lies. If the person is an existing visitor, i.e. someone who has visited in the past, his or her details are already stored, so that person just needs to be assigned a visit from the visits table (since one person can have multiple visits), if it is a previous visitor, I am finding it hard to assign another visit to that person's name. For example if Joe Bloggs visited in the past, and his details as well as previous visit are already stored, then how do I assign another visit to him via a form. I can do this via the datasheet view, but not from within a form.

Since it is unrealistic for a visitor to remember his or her name, there must be a way of typing name and surname into a form to query the database (which I know how to do), but then based on that it needs to return that person's visitor ID which can then be added into the visits table once again (the two are related),

So to summarise the problem, i need it so by entering name and surname, that person's visitor ID is returned and if more than one person with same names a record can be selected by showing the whole record. From this, based on the selection that specific visitor's ID needs to show in the form and then the visit details can be entered into the form and all this is inserted into the visits table (visitor ID in visits is linked to visitor ID in visitor, so by entering the visitor ID in visits, it is automatically assigned to the appropriate visitor).

My guess is some sort of query, but i really have no idea how to go about solving the problem. Please help.
Jan 17 '08 #1
6 1450
Dököll
2,364 Expert 2GB
Im trying to create a database for a visitor logging system. Basically, if the visitor has never visited before, he or she must be entered into the database and "signed in". All of the visitor details are stored in a "visitors" table. Here's where the problem lies. If the person is an existing visitor, i.e. someone who has visited in the past, his or her details are already stored, so that person just needs to be assigned a visit from the visits table (since one person can have multiple visits), if it is a previous visitor, I am finding it hard to assign another visit to that person's name. For example if Joe Bloggs visited in the past, and his details as well as previous visit are already stored, then how do I assign another visit to him via a form. I can do this via the datasheet view, but not from within a form.

Since it is unrealistic for a visitor to remember his or her name, there must be a way of typing name and surname into a form to query the database (which I know how to do), but then based on that it needs to return that person's visitor ID which can then be added into the visits table once again (the two are related),

So to summarise the problem, i need it so by entering name and surname, that person's visitor ID is returned and if more than one person with same names a record can be selected by showing the whole record. From this, based on the selection that specific visitor's ID needs to show in the form and then the visit details can be entered into the form and all this is inserted into the visits table (visitor ID in visits is linked to visitor ID in visitor, so by entering the visitor ID in visits, it is automatically assigned to the appropriate visitor).

My guess is some sort of query, but i really have no idea how to go about solving the problem. Please help.
Hello, Risk80!

Nicely detailed info...

You came to the right place, please fetch deeper into the pages, you will find posts on search mechanisms that'll work for you.

Currently on a project, turning in now, but do stay tuned, if other experts hadn't gotten to this, I'll fetch you something I know will work, of course you'd have to do a lot of the leg work:-)

In a bit!
Jan 18 '08 #2
Minion
108 Expert 100+
I have a very similar project to this that I am working, but I think we're taking slightly different approaches. Regardless I should be able to dig something up for you that will work or at least a link to some of the threads there that have helped me, I'll have to look around.

First though I was wondering two things that I faced:

1. Are you only referencing people by their names? If so what happens when you run into individuals with the same name?

2. Can more than one more person be assigned to any one visit?

Like I said I'll try and dig some things up that might help, but for now let me point you at the DLookup function as this may get you moving in the right direction.

Hope this helps.

- Minion -
Jan 18 '08 #3
Risk80
11
Thanks for reply
No, I am not only referencing people by name, each person has a visitor ID, which is linked to the visits table. It is unrealistic for people to remmeber their ID so it is easier if they provide their name and the appropriate record is selected. Each visit may only have one visitor, but a single visitor can have many visits.

It is not a problem for if the person is a new visitor, but the problem i face is assigning more than one visit to a given visitor. The data structure allows for this and relationships have been set correctly, and it works if i do it in the datasheet, but I am unable to replicate this in a form (changing to next record goes to the next record for both visitor and visits).

As a note, it works if I enter a field for visitor ID and manually type the desired visitor ID into the form, but i want a more user friendly way of doing this (ie. converting an entered name into a visitor ID, and if 2 or more people have the same name, list all records with that name so that the required one can be selected). Maybe a query, where the result is displayed as a combo box in the form so that the required visitor can be selected if more than one, but i dont know how i would implement this.

I will try experimenting in the meantime with dlookup.
Jan 18 '08 #4
lee123
556 512MB
Hi risk80,

i have made this search box but i don't know if it will help you at all but you can try this code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Text63_AfterUpdate()
  2.  
  3.      Dim mydata As String
  4.  
  5.      mydata = Text63  'WHAT YOU WANT TO USE EXAMPLE: TEXTBOX, INPUTBOX
  6.      If mydata = "" Or IsNull(mydata) Then Exit Sub
  7.      DoCmd.GoToControl "customername"  ' OR WHAT ARE YOU SEARCHING FOR
  8.      DoCmd.FindRecord mydata, acAnywhere, False, acSearchAll, , acCurrent, True
  9. End Sub
lee123
Jan 19 '08 #5
Risk80
11
Thanks lee, I used a modified version of your code and eventually got it to work. Thanks :-)
Jan 20 '08 #6
lee123
556 512MB
Glad i could help.

lee123
Jan 20 '08 #7

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

Similar topics

2
by: Sudheer Kareem | last post by:
Dear All Please tell me how to assosiate help files with my Vb.net Project. Regards Sudheer
2
by: Anita C | last post by:
Hi, How do I associate or map a specific column in a datatable to a particular element present in an xml document - to read into a datatable as well as write from the datatable to the xml element?...
7
by: BBFrost | last post by:
I'm receiving decimal values from database queries and placing them on a report page. The users want to see the following .... Db Value Display Value 123.3400 123.34...
5
by: MFC | last post by:
Ok, after three C# books, (C# How to Program, Programming in the Key of C#, and C# Weekend Crash Course) and three weeks, I believe I have tried everything to make a certain form function...
2
by: Brian | last post by:
I am very new to VB.NET and I just need some help in a listbox matter. I don't need suggestions on how to make the overall code better. I will get there. I want to move an item from one list box...
8
by: Alison | last post by:
Hi, Al I am trying to design a user interface which provides both menus and toolbars for some users to click on whatever they want to do, at the same time, I would like to have a console window...
1
by: Michael D. Reed | last post by:
I am using the help class to display a simple help file. I generated the help file using Word and saving it as a single page Web page (.mht extension). I show the help file with the following...
6
by: cj | last post by:
Lets just take this example I'm looking at now. I'm looking at the help screen titled .NET Framework Class Library FolderBrowserDialog Class . It gives an example at the bottom that begins with:...
0
by: BigAl.NZ | last post by:
Hi Guys, I am trying to write/copy some code that uses events with a GPS. Everytime the GPS position updates the event fires. The GPS code is from a SDK Library that I got called GPS Tools...
9
by: Ringo | last post by:
the LeafProject http://www.leafproject.org has a DLL for Face recognition. it is written in C++ but they interface to it from Lisp. I want to interface to it from C#. Their Lisp definitions looks...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...

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.