want form fields blank by default, no luck so far.

Sartek

Got LOST?
Local time
Today, 12:24
Joined
Sep 30, 2004
Messages
8
First Off, I must say that for the week or so prior to joining I've been reading the forums here like mad and they have been extremly helpful with everything..except my current issue, and I'll try and be as concise as possible. (done websearches on this one, disected teh NorthwindsDB, disected my "professionally done by someone else DB" that has all my data

I'm developing a personnel records database in Access 2K3.
(According to MS, the A2k file format is standard for 2K, 2K2-XP, and 2K3)

I'm using an unbound combo-box in my main form to pull specific records. these records are displayed in a subform on a tab control. this all works very successfully thanks to the information i found here.

I have made teh subform read only, meaning that the record specific information is only displayed. whoever is viewing the information cannot edit or select the info from this form. this is to prevent someone from randomly editing phone numbers or addresses, etc.

My issue is that when the main form is first displayed, the combobox is empty, as it should be, yet the subform is displaying the first record by default. I woudl like all the fields to be blank untill I select which record i would like to view in the combobox.

So far, I've tried the 'DoCmd' options that have been mentioned, and the Me.txtbox answers, I've tried setting the default value for the textboxes, and I've even tried entering a blank record into the primary table that the form displays info from, all to no avail.

I can't use the GotoRecord, or OpenForm answers becasue I have the form set for no editing allowed, otherwise they display a blank record only that lets me enter data to my heart's content, and nothign else.

the Me.txtbox="" just doesn't seem to have any effect whatsoever.


I have 2 forms (Main + Subform), 2 Queries (combobox data + complete info), and 3 tables (1 to 1 relationship, ID defined as master)

Almost a week of reading these forums has gotten me a long ways, especially since i have ZERO prior experience with a database structure like this and it's been 6 years since i've made a DB using access (way back in highschool).
 
Base your subform on a parameter query which references your combo in it's criteria
 
I don't know that I can do that. my attempts so far have been ugly to say the least. I think one of my problems is that the data being displayed on the subform is from all 3 tables. It's sorted by name (from one table) , but linked by ID#. I do know that my biggest problem is trying to relearn everythign and understand it.

I think the vba for the combobox may also have somethign to do with it. It tells the subform which ID to use, therefore writing the correct record to the screen.

(edit: my email is accessible now in my profile, along with all my IM's)
 
Last edited:
Then I assume the subForm is based on a query, in the criteria for the ID column in the Query just put Forms!YourMainFormName!YourCombo, the code builder will create the correct form references for you. The only vba you need then in the AfterUpdate of your combo is subFormName.Requery
 
Yes, the subform is based on a query... and it looks like it partially worked. When I open jus tthe subform, I get a prompt for the parameter value (the ID# ), which in this case would be the bound to column2 of the cboBox.

that pulls up the correct record in teh subform.

the problem now arises that if I try and open the Main form, the cboBox is there, but the Tab Control and the Subform have disappeared. :confused:
 
Does it matter that the subform isn't visible until a value has been selected from the combo?
 
misunderstood.. the subform doesn't show up at all. whether a choice has been made in the combo box or not..

Here's new attachment with what I have so far. I'm beginning to suspect it has somethign to do with a bug in teh tab control.
 
Last edited:
I only have 97, you'll have to post a 97ver if you want me to take a look
 
ok, converted to 97...i hope it works ok.. access said i was missing some a97 information (?)
 

Attachments

Has anyone called you a god lately?

(two copies made and now for some DISECTION!!) w00t!
 
well, for those out there looking for a similar solution to a complex(?) issue, i guess this would be it. I know there are a dozen or so on a separate forum.

hmm keywords for searching the forums: combobox tab record blank default
 
And now, for the sake of being difficult, is it possible to have the form fields show before the subform is refreshed?

(I'm thinking of any possible way of cheating here, like putting the field outlines on the tab control of the main form in the same place where they would be in the subform, without causing issues.)

My main db works wonderfully now that I've given the sample a thorough autopsy. I've even got it working on mutiple tabs.
 

Users who are viewing this thread

Back
Top Bottom