Newb Question on linking tables

Ok so 2 questions, hopefully simple ones.... first off Ive started altering my code like you suggested and its going fine, I had to add another variable for some reason, Im not entirely sure why I NEED a Publisher_Edit_SQL but I couldnt get it to work without it for the life of me.... looks nicer with it anyway so I wont complain, it will allow me to troubleshoot the update line easier since now its in 1 location instead of 2.

I don't know if this will solve your problem or not but you should be using "Option Explicit"

This forces all Variables to be declared as to what type they are. I believe this is important but you can get away with out it if you are good enough. I know I am not so I always use it.
 
White space is used by all good programmers. Not all people here are good, so I post a simple sample of some code that uses spacing correctly.

Code:
Option Explicit
Option Compare Text

Private Const conTableName As String = "tblGlobals"
Private Const conFieldName As String = "Item"
Private Const conKeyName   As String = "Key"

Public ColourLocal         As Variant
Public ColourNetwork       As Variant
Public DropboxLocal        As Variant
Public DropboxNetWork      As Variant


Private Sub Class_Initialize()

    ColourLocal = DLookup(conFieldName, conTableName, conKeyName & " = 'ColourLocal'")
    ColourNetwork = DLookup(conFieldName, conTableName, conKeyName & " = 'ColourNetwork'")
    DropboxLocal = DLookup(conFieldName, conTableName, conKeyName & " = 'DropboxLocal'")
    DropboxNetWork = DLookup(conFieldName, conTableName, conKeyName & " = 'DropboxNetWork'")

End Sub
 
There are some people here who can read your code as posted and tell you what you have done wrong.

I don't even try because it is easier to do so within a working Database.

If you can post that I will have another look.


Looking at your code you use "Publisher" several times. Is it necessary? You could make reading a lot easier without it.
 
I have looked at your latest version that you have posted.

There is only one form frmPublisherList. This form does not appear to do anything. What am I missing?

I looked at the latest version of your Table design and it looks pretty good. If there is any fault you may not find it or them until further down the track. But this is life when writing such things. Because you are using Access it will be fairly easy to go back and make the necessary changes.
 
frmPublisherList updates my tblPublishers, and no I suppose I dont need to have the word Publisher in there as much, its more for me so I know quickly which parts of my code refer to either variables or my table.

I'll give option explicit a try, for the most part my variables seem to work perfectly except for how I mentioned earliar that something funky is going on if I try to edit the same part of my table twice, it brings up the first value, not the edited even though I see the edited value on my table... This may be a problem with listboxes as I found occasionally people complaining about similar issues via google.... but so far I havent found a solution.


as for my exit sub, like only reason I have it empty right now was to remind myself I was going to do stuff with it later... for instance if I want to add a publisher from my series table I want to be able to press a button that pops up my publisher form, however when my publisher is done and exits I want it to also requery my series table so the info I see will be updated.



As for current table, here ya go I attached it.

Disregard formSeriesSave it does nothing as of yet... Im still working on getting it to look how I want before I start making the elements functional
 

Attachments

What is it that you need help with.

What do you try to do that does not work.

Please explain.
 
If you go into my pubisher list form and edit one of the publishers.... now without closing the form edit the same publisher again

See if it bugs for you.... for me if I say edit a publisher named 'test' to 'Test3' 'Test3' will show up on my listbox but when I go to edit it a 2nd time the name that pops up to be edited is 'test'

Its not a real big bug but I cant figure it out, if needed Ill live with it but if theres a fix I want to make it.
 
If I go to your form I cannot do anything.

It is locked to me. Clicking on the Edit Button does nothing.
 
weird... why would it do that to you yet work for me?
 
could it be that you have active content disabled? I know I had to click the top to enable content when loading the first time.
 
well got it working.... not entirely sure why it works now but it does lol

I threw in a Me.publistList = Null and everything started working fine, weird.

luckily, while I was trying to figure out the issue I found another issue in my code as well and fixed it too lol, there was a problem with one of my IF lines, I was sending a situation to the wrong If, but its fixed now too so I think Im finally done with this form
 
Well done.

It took a bit on your behalf but worth it in the end.

I trust you learnt some things to apply to the next form.
 

Users who are viewing this thread

Back
Top Bottom