Adding records using a form and add record button (1 Viewer)

qazwsx16

New member
Local time
Today, 08:07
Joined
Aug 9, 2014
Messages
6
Hi everyone,

Just became a new member while searching for a solution for an issue I've been having. So a quick background, I'm currently interning for a state organization and I've been given the task of making them a Access database.. I've maybe opened Access once intentionally but many time on accident. Haha.

Main point is: I'm love learning about technology, but I usually need a few tries to get the hang of things; and I'm not too familiar with Access.

They gave me one weekend to finish so I was hoping to get help from the pros. They mainly want to be able to enter data into a form (and have an "add record" button) and have it transfer to a table. They also want the table to be present in the form and be continually updated as we enter data into it.

So far I've been able to create the fields in the form and have people write in responses. I haven't been able to create an "add record" button or have an updating table in the form.

I am in extreme need of help! The only way I can think of incentivizing this is by donating $1 for every reply to a charity you guys choose. Please help!

EDIT: This will be on a 2007 database!
EDIT 2: Attached contains the file that I've working on so far. It might not be the cleanest looking..
 

Attachments

  • Test 2.accdb
    800 KB · Views: 60
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 16:07
Joined
Jul 9, 2003
Messages
16,360
>>>They mainly want to be able to enter data into a form (and have an "add record" button) and have it transfer to a table. They also want the table to be present in the form and be continually updated as we enter data into it<<<

>>>or have an updating table in the form<<<

I don't understand?

MS Access forms update automatically, you don't need a button. Is someone winding up the new guy?

Is this the tech version of the "Long Weight"?
 

bob fitz

AWF VIP
Local time
Today, 16:07
Joined
May 23, 2011
Messages
4,726
Is this the tech version of the "Long Weight"?
I'm not sure Uncle. Hang about on and we'll find out.:D
 

qazwsx16

New member
Local time
Today, 08:07
Joined
Aug 9, 2014
Messages
6
Sorry for the late reply, I've been moving into my new apartment.

So basically, I'm creating this Access for people who enter our data into the system. So if you were able to open the file I was trying to show kind of what they want (It's in the "Abstract Status" Form). They want to type in an AbstractID of their choice, a "Date Record Initiated" (appears by itself), they select an Abstract Source and Data Transmission Method, and then click "Add Record". And then it will appear in the table below it.

I hope that makes sense, if not please let me know I can clarify!
 

qazwsx16

New member
Local time
Today, 08:07
Joined
Aug 9, 2014
Messages
6
Any help? Sorry to double post, I just really need this help in the next few hours :banghead:

But please don't forget to post your favorite charities in the mean time!
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 01:07
Joined
Jan 20, 2009
Messages
12,856
Create an unbound main form and put your current form on it as a subform.

Add another subform based on the table. Requery it when the record is added on the data entry subform.

The button to save the record really ins't necessary. Access will automatically save any changed or new record on a bound form when the focus moves to another record.

If you want a choice for it to not save then allow the user to Cancel the update with a dialog in the On Current Event.
 

qazwsx16

New member
Local time
Today, 08:07
Joined
Aug 9, 2014
Messages
6
Create an unbound main form and put your current form on it as a subform.

Add another subform based on the table. Requery it when the record is added on the data entry subform.

The button to save the record really ins't necessary. Access will automatically save any changed or new record on a bound form when the focus moves to another record.

If you want a choice for it to not save then allow the user to Cancel the update with a dialog in the On Current Event.

Thank you so much! So I've gotten everything to work now except one small detail. For some reason, in my form where they are adding records, after they click, save/new the record they were working disappears from the subform table. Is there a way to have that table show every single record that is in that table all the time (and continually updating?)?

For example, right now you can see the record you are currently working on, but when you click the left or right arrows it won't take you to previous or newer ones. Ideally I would want all the records to show. I've attached the current version.
 

Attachments

  • Test 2.accdb
    864 KB · Views: 59
Last edited:

qazwsx16

New member
Local time
Today, 08:07
Joined
Aug 9, 2014
Messages
6
Interesting table and relationship design you have there.

OH! Definitely ignore that! I quickly got rid of that once I realized what I did wrong. Everything is looking and running much better on my access file now :)

Quick question though. Is it possible to do an if/then/else statement? Like if one variable is equal to 1, then another variable will equal "Hospital", else if it equals 2, then it will equal "Pathology Lab", else...etc.?

If so, do you know where I would write that and any links to tutorial pages? Thank you in advance!
 

qazwsx16

New member
Local time
Today, 08:07
Joined
Aug 9, 2014
Messages
6
OH! Definitely ignore that! I quickly got rid of that once I realized what I did wrong. Everything is looking and running much better on my access file now :)

Quick question though. Is it possible to do an if/then/else statement? Like if one variable is equal to 1, then another variable will equal "Hospital", else if it equals 2, then it will equal "Pathology Lab", else...etc.?

If so, do you know where I would write that and any links to tutorial pages? Thank you in advance!

So I tried writing this code for my "Hospital" toggle button (Let me know what you guys think):

Private Sub Toggle27_Click()
Dim varAbsSource As Integer

varAbsSource = [Abstract Status]![Abstract Source]

If varAbsSource = 1 Then [Abstract Status]![Abstract Source 2] = "Hospital"
ElseIf varAbsSource = 2 Then [Abstract Status]![Abstract Source 2] = "Pathology Lab"
ElseIf varAbsSource = 3 Then [Abstract Status]![Abstract Source 2] = "Physician Offices"
ElseIf varAbsSource = 4 Then [Abstract Status]![Abstract Source 2] = "Death Follow-back"
ElseIf varAbsSource = 5 Then [Abstract Status]![Abstract Source 2] = "Lab-Follow-back"
ElseIf varAbsSource = 6 Then [Abstract Status]![Abstract Source 2] = "Interstate Exchange"
End If

End Sub


I created a separate variable in my table called Abstract Source 2 that would have the converted value when the user clicks the "Hospital" button. But for some reason it's not working.. Any advice? Did I put it in the wrong location?
 

Users who are viewing this thread

Top Bottom