473,698 Members | 2,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to organize my Record Sources & Control Sources in subform data entries

Knut Ole
70 New Member
Hi,
I have a mainform for a new camping reservation, with a subform for entering a new contact upon making a new reservation. I also have a subform for editing a contact on-the-run when making a new reservation.

I've become a bit confused, however, as to whether I'm organizing it correctly, and I plain wonder how to update the respective fields after entry.

I have the following (relevant) tables:
BOOKINGS
--ID, ContactID, RoomID, Time...etc
CONTACTS
--ID, LastName, FirstName, Mobile...etc
ROOMS
--ID, RoomNumber...et c

and the following (relevant) forms:
FORM18 *
-RecS is a query with the three above tables connected
-it has comboboxes with ContactID, LastName, FirstName, where the user can find a contact and the rest is filled in. (all working fine.)
-another combobox for RoomID
*(it's actually QUERY18 in the code, excuse the name, im hesitant to change it before i have working code! =)

then buttons to start up subforms for 1) entering new contact on-the-run, 2) editing existing contact on-the-run.

SUBFORM1 (new contact)
-recS is a query with only CONTACTS form
-this works with creating new contacts and updating main form

SUBFORM2 (edit)
-recS is a query with only CONTACTS form
-i cant figure out how to update the main form with it...

this is the code for pressing the Edit Contact button in main form:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command375_Click()
  2. 'Edit contact info button
  3.  
  4. 'cefLN = Form_Query18.ctlContactEditForm.Form!LastName.Value
  5. 'Forms!Mainform!Subform1.Form!Subform2.SourceObject
  6. idContact = Me.ContactID.Value
  7. MsgBox "contactID = " & idContact
  8. cefLN = Me!ctlContactEditForm!LastName.Value
  9. cefLN2 = Forms!Query18!ctlContactEditForm!FirstName.Value
  10. MsgBox cefLN & ", " & cefLN2
  11.  
  12. Form_Query18.ctlContactEditForm.Visible = True
  13. 'Form_Query18!ctlContactEditForm.Form!ContactID.Value = editID
  14. 'Form_ContactEditForm.ID.Value = editID
  15. End Sub 
which is nothing really, cause im struggling... and On Load on subform
Expand|Select|Wrap|Line Numbers
  1. :
  2. Private Sub Form_Load()
  3. 'Me.ContactID.Value = 1
  4. Set rstBookings = CurrentDb.OpenRecordset("Contacts", dbOpenTable)
  5.     With rstBookings
  6.         returnID = !ID
  7.     End With
  8.     MsgBox returnID
  9. End Sub
  10.  
1) but is this the right way to set it up?
2) i'm not able move to the correct contact when opening the subform that edits existing contacts!
3) when i call OpenRecordset, for "Contacts" for example, does that go for all comboboxes that are connected to Contacts? or just for the current form?
4) and how to move the combobox recordset on the subform to the same position as on the mainform for Contacts?

sorry about rather longish question, just hope i havent left anything out.

thank you very much for any help...
Apr 27 '11 #1
0 989

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

Similar topics

1
4745
by: Tim Graichen | last post by:
Hi! I have a subform (ShedTableSubForm) at the bottom of my MAIN form. I would like to do two things. 1) preview on screen a report (ShedReport) of the subform data the record currently displayed in the main form 2) print a report (ShedReport) of the subform data for only the animal displayed in the main form
6
1582
by: Paul T. RONG | last post by:
Dear all, The OrderDetail subform has following fields: OrderDetailID OrderID ProdID Quantity Price how to get the OrderDetailID of a record I sellected in Orderdetail subform using VBA? Thank you very much
1
3078
by: RzB | last post by:
In a previous post in this NG (Oct 98) http://makeashorterlink.com/?D505347FB Henry Craven says that he was investigating a relationship between the presence or absence of a "Me!" prefix, the value of the Top propery of a control, and the occurrence of an invalid runtime error "The control or subform control is too large for this location"
0
1075
by: 詹亚军 | last post by:
can activex control export large data to container by event's para ? I develop a activex control,and want to export large data to container(IE),web page can use javascript to capture the event,and then utilize the event's para to do more things. First ,I am not sure how much data can be exported by control event's para ? Second,I don't want to export large data by so many paras,such as largedataevent(para1,para2,para3,...... )
8
18221
by: anansi | last post by:
Hi I have a form called 'shiftviewer' and it contains a subform called 'all shifts for current month subform'. the subform is in datasheet view (access 2007) and the main form is a column orientated form. Both forms contain records of 'shifts' I want to be able to select a record (a shift) in the subform, and be able to set the parent form's current record to that record, through the identifying primary key that a shift record has...
7
2186
Dököll
by: Dököll | last post by:
Hey Gang! I am at work, will attempt to make it brief:-) Looks like I am unable to print subform data results. When the subform loads with the results I want, say from 9,000 records, I get 100 + out of that. I can't seem to print just the results or preview in a report. I know I've missed something. Searched here did not find anything, please point me to it! Here's a modifcation of the code:
1
1443
by: jbs255 | last post by:
Hello friends, i have create a datareport in vb 6.0. i have to display some data through programming in data report. i have to do in by datareport1.conrol( i ) = "abc". but the problem is that how i can know about index No. of controls. Pls. guide me soon. control (i) in data reports in vb6 thank you very much
4
6146
by: Deano | last post by:
I have a little search routine going whereby the user types in some text and clicks a button on the main form. I then see if that text exists in a record on the subform. I get a match, grab the record id and am now trying to automatically highlight that record in the subform to show the user they got a hit. How can I select that record and then perhaps move the focus into a specific textbox? I'm trying this a number of ways and...
4
3588
by: Amarantine | last post by:
I have a from and a subform and I need to stay on the same record when I move from the main form to the subform. I have a "next" button with a macro on the last page of the form which navigates to the subform. However, I don't know how to follow the same record on the form and subform as new user adds a new record. My knowledge of codes and VBA and Microsoft Access is very limited. I tried to get around with macros so far this is the last...
0
1050
by: anthony lapenna | last post by:
How do I set default values so the data entries carry over to a new record
0
8678
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9030
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4621
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2333
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.