Copy certain values from one table to another, fill the rest from a form.

Best Microsoft Access Programmer Portland OR

Copy certain values from one table to another, fill the rest from a form.

I’m working on a meal program to track meals on a trip for people in different sections, as per my schema below:

https://i.redd.it/6b9i6wzz4fg31.png

Meal Defaults is a table consisting of yes/no checkboxes for certain [mealDate]’s, and is related to Meal Default Sections which stores the section names (they can be edited by the user which is why I chose this approach). What I want to do is have a little reset button under my main Member form which when pressed will check which section a member is in, and then fill in the Default dates associated to that section.

The reason this is so difficult is because of the [ID] column in Meals, which is supposed to be the member ID. So I can’t just do:

INSERT INTO Meals SELECT mealDate,Breakfast,[Boxed Lunch],[Late Supper] FROM [Meal Defaults] AS a INNER JOIN [Meal Default Sections] AS b ON a.ID=b.Section WHERE [Section Name]="Group A" 

because I also need to insert member_id from the form. I was thinking something like this perhaps:

INSERT INTO Meals (mealID) VALUES (Me.memberID.Value) SELECT mealDate,Breakfast,[Boxed Lunch],[Late Supper] FROM [Meal Defaults] AS a INNER JOIN [Meal Default Sections] AS b ON a.ID=b.Section WHERE [Section Name]="Group A" 

I am just confused as to how I go about implementing this feature. If anyone could help me at all, I would really appreciate it.

submitted by /u/hquaker1
[link] [comments]

Get the best Microsoft Access consultant

Get the best Microsoft Access programmer

Microsoft Acess Developer Portland OR

Copy certain values from one table to another, fill the rest from a form.

Best Microsoft Access Programmer Portland OR

Copy certain values from one table to another, fill the rest from a form.

I’m working on a meal program to track meals on a trip for people in different sections, as per my schema below:

https://i.redd.it/6b9i6wzz4fg31.png

Meal Defaults is a table consisting of yes/no checkboxes for certain [mealDate]’s, and is related to Meal Default Sections which stores the section names (they can be edited by the user which is why I chose this approach). What I want to do is have a little reset button under my main Member form which when pressed will check which section a member is in, and then fill in the Default dates associated to that section.

The reason this is so difficult is because of the [ID] column in Meals, which is supposed to be the member ID. So I can’t just do:

INSERT INTO Meals SELECT mealDate,Breakfast,[Boxed Lunch],[Late Supper] FROM [Meal Defaults] AS a INNER JOIN [Meal Default Sections] AS b ON a.ID=b.Section WHERE [Section Name]="Group A" 

because I also need to insert member_id from the form. I was thinking something like this perhaps:

INSERT INTO Meals (mealID) VALUES (Me.memberID.Value) SELECT mealDate,Breakfast,[Boxed Lunch],[Late Supper] FROM [Meal Defaults] AS a INNER JOIN [Meal Default Sections] AS b ON a.ID=b.Section WHERE [Section Name]="Group A" 

I am just confused as to how I go about implementing this feature. If anyone could help me at all, I would really appreciate it.

submitted by /u/hquaker1
[link] [comments]

Get the best Microsoft Access consultant

Get the best Microsoft Access programmer

Microsoft Acess Developer Portland OR