Forms Sub forms and a Enter button

  • Thread starter Thread starter MikeBailey
  • Start date Start date
M

MikeBailey

Guest
Hi all I’m new to Access and trying to learn a few things! So to teach my self a few things I thought I would build a data base to store all my backed up software. The tings I want to be able to do is enter the name of the product the maker, serial numbers (more than one possibly) and I would like to be able to choose a category like game, app or operating system.

Because this is for backed up software I want to assign a label. I would like the label to be a number so I can put that number on the jewel case. Then when I need to retrieve something I can just look up the name or what ever then go to that number in the box of all that stuff..

I have competed the project the only thing I wasn’t able to do is add a Enter button. So I have my data base set up with the software info in one table and the serial numbers in another so its one to many the many being being the serial numbers. So on the form I need a button to click to go to new record on both the main form and the sub form.

Can anyone help :confused:

I have included the data base if anyone would like to look at it. Suggestions, tips and comments are greatly appreciated. Pleas remember I am a newbie trying to learn. :D
 

Attachments

Last edited:
Hi Mike,

You forgot to post your database. However, here's something I created and I hope you can get the idea from that.

Hope that helps :)
 

Attachments

Thanks for the reply. I have a couple of questions. Why did you put the software publisher as the primary key? I mean you can have more than one piece of software from the same publisher like Microsoft Windows and Microsoft Office Also you have the serial number set to auto number? And I think you have your relationship backwards.

I uploaded my file I’m still working on it. I haven’t decide on the final look and I cant seem to find the code you used for the enter button. :confused:
 
Hi there Mike,

Good questions you asked there m8 about PK and Autonumber etc. In my own defence :) I had just spent about 20 odd hours on my database and probably I was tired when I created the database yesterday. However, on a positive note, I have modified your database which I am sure will meet your requirements.

I would also like you to look at the code on the On-Click events of the buttons and shortly, you will be able to add more functionality to your application.

Hope that helps
 

Attachments

Wow

Thanks a lot for taking the time to add the buttons and code. There’s not a lot of people that would have taken the time to do that :D

I looked at the Event Procedure and I will save that code for future use. I have some questions about the code so I understand fully what is going on. I noticed that the button for the add new software on the main form also takes you to a new record on the sub form. Is there code some ware for that other than the code in the Event Procedure? Or is it just handled automatically by Access by linking the two forms together?

Can you pleas tell me what this does?

Code:
    On Error GoTo Err_addnew_Click

And this

Code:
 Err_addnew_Click:
    MsgBox Err.Description
    Resume Exit_addnew_Click

I think that code will just give a message box on the error then exit the command is that correct?

I really liked the look and feel for yours and will try to fashion my the same.

Agene thanks for all the help :D
 
Last edited:
Mike,

Thannx and happy to be of help. One thing you will learn through time on this forum, is the great help you get from others. I have learned a lot myself through this particular forum over the last 18 months.

Anyway m8. That part of the code, is an error handler. For example, if you set your form properties to disable add new records, and the user clicked that button, they would be told that they cannot goto the specified record. In otherwords, instead of adding a new record, it has detected a problem and delivering the error handler.

--------------------------------------------------------------------------
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click


DoCmd.GoToRecord , , acNewRec

Exit_Command0_Click:
Exit Sub

Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click

End Sub
--------------------------------------------------------------------------
 

Users who are viewing this thread

Back
Top Bottom